Property

new DaoBase(name)

Creates a new data access object.

Parameter

Name Type Optional Description

name

string

 

The name of the data access object.

Throws

Dao error: The data access object name must be a non-empty string.

Property

read-only
name  string

The name of the data access object.

Methods

$hasCreate() → boolean

Determines if create method exists.

Returns

boolean True when create method exists, otherwise false.

$runMethod(methodName[, ...methodArg]) → any type

Executes the named method on the data access object.

Parameters

Name Type Optional Description

methodName

string

 

The name of the method to check.

methodArg

any type

Yes

The arguments of the method to execute. The last argument must be a callback function in case of asynchronous models.

Value can be repeated.

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

any type The result of the method (for synchronous models).