DAO for information_schema.tables of mysql instances
package | salt\dao |
---|---|
inherited_from | \salt\Base |
COLUMN(string $fieldName, mixed $format = NULL
) : string
string
the fieldName to display
mixed
(Optional, NULL) the format to use
string
ViewHelper HTML protected text to display for $fieldName in $formatFORM(mixed $format = NULL
) : \salt\_InternalFieldAccess
mixed
(Optional, NULL) format to use
\salt\_InternalFieldAccess
an object for access registered ViewHelperVIEW(mixed $format = NULL
) : \salt\_InternalFieldAccess
mixed
(Optional, NULL) format to use
\salt\_InternalFieldAccess
an object for access registered ViewHelper__construct()
Have to be called by child classes for having an internal ID
__get(string $fieldName) : mixed
Can also return an _InternalFieldAccess if $fieldName is FORM or VIEW
string
mixed
the value of the field__set(string $fieldName, mixed $value)
string
the field to change
mixed
the value
checkNotState(integer|array<mixed,integer> $state, string $message = NULL
)
integer
array<mixed,integer>
forbidden states for the object
string
error message for exception
\Exception |
if the object is in one of the forbidden states |
---|
checkState(integer|array<mixed,integer> $state)
integer
array<mixed,integer>
expected states for the object
\Exception |
if the object is not in one of the expected states |
---|
getById(\salt\DBHelper $db, mixed $id) : static | NULL
\salt\DBHelper
The database to search object
mixed
a value of the id field
static
NULL
the first object with this id. All fields are loaded. Return NULL if no object foundgetByIds(\salt\DBHelper $DB, array<mixed,mixed> $ids) : array<mixed,static>
\salt\DBHelper
database to search objects
array<mixed,mixed>
list of value to search
array<mixed,static>
associative array : id => objectgetField(string $fieldName, boolean $createIfNotExists = FALSE
) : \salt\Field
string
field name registered with metadata() or extra field constructor parameter
boolean
if TRUE, create extra field if not exists, throw Exception otherwise
\salt\Field
getFieldsMetadata() : array<mixed,\salt\Field>
array<mixed,\salt\Field>
list of all Field metadata : fieldName => FieldgetId() : mixed
mixed
value of id fieldgetIdField() : string
string
field namegetInternalId() : integer
integer
Unique ID of an instancegetModifiedFields() : array<mixed,mixed>
array<mixed,mixed>
fieldName => valuegetNew(array<mixed,string> $extraFields = NULL
) : static
array<mixed,string>
array of fieldName to add to the instance
static
getTableName() : string
string
the table nameinitAfterCreateTable() : array<mixed,static>
array<mixed,static>
objects to create in tableisLoaded() : boolean
boolean
TRUE if the object have been loaded for a database by PDOisModified() : boolean
boolean
TRUE if the object have been modifiedisNew() : boolean
boolean
TRUE if the object have been created with a new ...()isReadonly() : boolean
boolean
TRUE if the object is readonly (Base::meta() is a readonly object)missingTables(\salt\DBHelper $db, array<mixed,string> $tableNames) : array<mixed,string>
\salt\DBHelper
database to use
array<mixed,string>
list of table name to check
array<mixed,string>
list of missing tablesreadonly()
registerHelper(string $class)
string
class name of ViewHelper that will by used in $this->VIEW/FORM/COLUMN
registerId(string $fieldName)
registerTableName(string $table)
string
the table name that will be used in query generation
checkFieldExists(string $fieldName, boolean $forValue= FALSE
, boolean $doNotThrowException= FALSE
) : boolean
string
boolean
also check field is loaded and value can be retrieve
boolean
return FALSE if field does not exists instead of throwing exception
\Exception |
if field don't exists or is not loaded (if $forValue) |
---|
boolean
TRUE if field existsinitMetadata(array<mixed,string> $loadedFields= NULL
, array<mixed,string> $extraFields= NULL
)
array<mixed,string>
fields loaded by a query for this object
array<mixed,string>
fields to add to new instance only
\Exception |
if metadata() function don't return an array of Field |
---|
$_saltExtraFields : array<mixed,mixed>
array()
content | array of extraFieldName => value |
---|
$_saltExtraFieldsMetadata : array<mixed,\salt\Field>
array()
content | array of extraFieldName => Field |
---|
$_saltLoadValues : array<mixed,mixed>
array()
content | array of fieldName => value |
---|
$_saltMetadata : array<mixed,mixed>
array()
content | array of class name => array( 'fields' => array(field name => Field), 'tablename' => table name, 'idfield' => id field name, 'singleton' => empty instance, ) |
---|
$_saltState : integer
self::STATE_NONE
$_saltValues : array<mixed,mixed>
array()
content | array of fieldName => value |
---|
$_salt_id : integer
$_salt_id_sequence : integer
0
STATE_DELETED = 40
STATE_LOADED = 20
STATE_LOADING = 21
STATE_MODIFIED = 30
STATE_NEW = 10
STATE_NONE = 0
STATE_READONLY = 50