API - AbstractTable

Extends ObjectManager

This class holds the basic methods of the table object.

Methods

This is the default _afterDelete method which needs to be overridden!

Parameters
Name Type Description
context CommandContext The context to use in this method

This is the default _afterInsert method which needs to be overridden!

Parameters
Name Type Description
context CommandContext The context to use in this method

This is the default _afterSelect method which needs to be overridden!

Parameters
Name Type Description
context CommandContext The context to use in this method

This is the defaul t_afterUpdate method which needs to be overridden!

Parameters
Name Type Description
context CommandContext The context to use in this method

This is the default _beforeDelete method which needs to be overridden!

Parameters
Name Type Description
context CommandContext The context to use in this method

This is the default _beforeInsert method which needs to be overridden!

Parameters
Name Type Description
context CommandContext The context to use in this method

This is the default _beforeSelect method which needs to be overridden!

Parameters
Name Type Description
context CommandContext The context to use in this method

This is the default _beforeUpdate method which needs to be overridden!

Parameters
Name Type Description
context CommandContext The context to use in this method

This function will be available for every object, this will clone the current object.

Returns Object: An exact copy of the current object

This method will execute a certain command combined with a context. This method will also call specialized for the selected method. The methods callable are: Select, Insert, Update and Delete.

Parameters
Name Type Description
method String The method to execute.
context CommandContext The context object to use in this call.

This is a private function to allow for config extending This method takes two parameters the first is the original config and the second will be appeneded to this one.

Parameters
Name Type Description
target Object The config object.
source Object The object to extend the config object.

This method will return the adapter associated with the current table object

Returns Promise: The associated adapter.

This method will return all the columns of the table.

Returns Promise: The columns of the table.

Return the command chain to run behaviors.

Returns CommandChain: CommandChain object.

Use this function to acquire a variable from config.js

Parameters
Name Type Description
key String Key to specify the config to return

Returns Object: The requested config value.

Use this function to acquire the identifier object

Returns ObjectIdentifier: Identifier object.

This method will return the single identity column, identified by the auto_increment value.

Returns Promise: The promise with the identity column.

This method returns the name of the table.

Returns String: Table name

This is a alias of ObjectManager.getObject to use in the "this" context.

Parameters
Name Type Description
identifier String Identifier of the object to load
config Object|null Config to push to the object

Returns Promise: call ".then" to use the object when ready.

This method will return an empty Row object Here we will also cache the Row object for later use.

Returns Promise: Returns a Row object

This method will return an empty Rowset object

Returns Promise: Returns a Rowset object

This method will check if the table exists or not, if not, it will return an error. Else an object with its schema is returned.

Returns Promise: The promise with the complete schema.

This method will return the unique columns of the table

Returns Promise: The unique columns of the table.

Every object called through getObject will go through this function. This will set the identifier and adds the behaviors (if any).

Parameters
Name Type Description
config Object Object with config values

Returns Promise: call ".then" to use the object when ready.

This method will translate table columns to their original values, or visa versa. This will work on the column_map variable.

Parameters
Name Type Description
object Object The object with the column map
reverse Boolean Wether or not to reverse the behavior

This is the handler which will try to mixin functions from another object.

Parameters
Name Type Description
object Object The object to mix into the current object.