Methods summary
public static
MvcCore\Ext\Models\Db\Connection
|
#
GetConnection( string|integer|array|stdClass|null $connectionNameOrConfig = NULL, boolean $strict = TRUE )
Returns \MvcCore\Ext\Models\Db\Connections database connection
by connection name/index, usually by system config values (cached by local store)
or create new connection of no connection cached.
Returns \MvcCore\Ext\Models\Db\Connections database connection
by connection name/index, usually by system config values (cached by local store)
or create new connection of no connection cached.
Parameters
- $connectionNameOrConfig
- $strict
If TRUE and no connection under given name or given
index found, exception is thrown. TRUE by default.
If FALSE , there could be returned connection by
first available configuration.
Returns
Throws
InvalidArgumentException
|
public
boolean
|
#
Save( $createNew = NULL, integer $propsFlags = 0 )
Process instance database SQL INSERT or UPDATE by automaticly founded key data.
Return TRUE if there is inserted or updated 1 or more rows or return
FALSE if there is no row inserted or updated. Thrown an exception in any database error.
Process instance database SQL INSERT or UPDATE by automaticly founded key data.
Return TRUE if there is inserted or updated 1 or more rows or return
FALSE if there is no row inserted or updated. Thrown an exception in any database error.
Parameters
- $createNew
- bool|NULL
- $propsFlags
Returns
boolean
Throws
|
public
boolean
|
#
IsNew( integer $propsFlags = 0 )
Try to determinate, if model instance is new or already existing in
database by property with anotated auto increment column.
If property is not initialized or if it has NULL value, than
model instance is recognized as new and TRUE is returned, FALSE otherwise.
Try to determinate, if model instance is new or already existing in
database by property with anotated auto increment column.
If property is not initialized or if it has NULL value, than
model instance is recognized as new and TRUE is returned, FALSE otherwise.
Parameters
Returns
boolean
Throws
InvalidArgumentException
|
public
boolean
|
#
Insert( integer $propsFlags = 0 )
Process instance database SQL INSERT by automaticly founded key data.
Return TRUE if there is updated 1 or more rows or return
FALSE if there is no row updated. Thrown an exception in any database error.
Process instance database SQL INSERT by automaticly founded key data.
Return TRUE if there is updated 1 or more rows or return
FALSE if there is no row updated. Thrown an exception in any database error.
Parameters
Returns
boolean
Throws
|
public
boolean
|
#
Update( integer $propsFlags = 0 )
Process instance database SQL UPDATE by automaticly founded key data.
Return TRUE if there is updated 1 or more rows or return
FALSE if there is no row updated. Thrown an exception in any database error.
Process instance database SQL UPDATE by automaticly founded key data.
Return TRUE if there is updated 1 or more rows or return
FALSE if there is no row updated. Thrown an exception in any database error.
Parameters
Returns
boolean
Throws
|
public
boolean
|
#
Delete( integer $propsFlags = 0 )
Process instance database SQL DELETE by automaticly founded key data.
Return TRUE if there is removed more than 1 row or return
FALSE if there is no row removed. Thrown an exception in any database error.
Process instance database SQL DELETE by automaticly founded key data.
Return TRUE if there is removed more than 1 row or return
FALSE if there is no row removed. Thrown an exception in any database error.
Parameters
Returns
boolean
Throws
|