new DaoBase(name)
Creates a new data access object.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the data access object. |
Throws:
Dao error: The data access object name must be a non-empty string.
Members
-
<readonly> name :string
-
The name of the data access object.
Type:
- string
Methods
-
$hasCreate() → {boolean}
-
Determines if create method exists.
Returns:
True when create method exists, otherwise false.
- Type
- boolean
-
$runMethod(methodName, methodArg) → {*}
-
Executes the named method on the data access object.
Parameters:
Name Type Argument Description methodName
string The name of the method to check.
methodArg
* <optional>
<repeatable>
The arguments of the method to execute. The last argument must be a callback function in case of asynchronous models.
Throws:
-
Dao error: The method name must be a non-empty string.
-
Dao error: Data access object has no method with the requested name.
Returns:
The result of the method (for synchronous models).
- Type
- *
-