DAO class for models without relationships Model classes must declare public members only Ubiquity\orm$SDAO This class is part of Ubiquity.
More...
|
static | update ($instance, $updateMany=false) |
| Updates an existing $instance in the database.
|
|
static | getDb ($model) |
|
static | getAll ($className, $condition='', $included=true, $parameters=null, $useCache=NULL) |
| Returns an array of $className objects from the database.
|
|
static | getAllByIds ($className, $keyValues=[], $included=true, $condition='', $useCache=NULL) |
| Returns an array of $className objects loaded by id from the database.
|
|
static | paginate ($className, $page=1, $rowsPerPage=20, $condition=null, $included=true) |
|
static | orderBy (string $className, string $field, string $order='ASC', string $condition='', bool $included=true, $parameters=null, $useCache=NULL) |
| Returns an array of $className objects from the database ordered by $field.
|
|
static | getRownum ($className, $ids) |
|
static | count ($className, $condition='', $parameters=null) |
| Returns the number of objects of $className from the database respecting the condition possibly passed as parameter.
|
|
static | exists ($className, $condition='', $parameters=null) |
| Tests the existence of objects of $className from the database respecting the condition possibly passed as parameter.
|
|
static | getOne ($className, $condition, $included=true, $parameters=null, $useCache=NULL) |
| Returns an instance of $className from the database, from $keyvalues values of the primary key or with a condition.
|
|
static | getById ($className, $keyValues, $included=true, $useCache=NULL) |
| Returns an instance of $className from the database, from $keyvalues values of the primary key.
|
|
static | connect ($offset, $wrapper, $dbType, $dbName, $serverName='127.0.0.1', $port='3306', $user='root', $password='', $options=[], $cache=false) |
| Establishes the connection to the database using the past parameters.
|
|
static | startDatabase (&$config, $offset=null) |
| Establishes the connection to the database using the $config array.
|
|
static | getDbOffset (&$config, $offset=null) |
|
static | isConnected ($offset='default') |
| Returns true if the connection to the database is established.
|
|
static | setTransformerOp (string $op) |
| Sets the transformer operation.
|
|
static | closeDb ($offset='default') |
| Closes the active pdo connection to the database.
|
|
static | setModelDatabase ($model, $database='default') |
| Defines the database connection to use for $model class.
|
|
static | setModelsDatabases ($modelsDatabase) |
| Defines the database connections to use for models classes.
|
|
static | getDatabase ($offset='default') |
| Returns the database instance defined at $offset key in config.
|
|
static | getDatabases () |
|
static | updateDatabaseParams (array &$config, array $parameters, $offset='default') |
|
static | start () |
|
static | getDbCacheInstance ($model) |
|
static | warmupCache ($className, $condition='', $included=false, $parameters=[]) |
|
static | setCache (AbstractDAOCache $cache) |
|
static | getCache () |
|
static | getModelsDatabase () |
|
static | _affectsRelationObjects ($className, $classPropKey, $manyToOneQueries, $oneToManyQueries, $manyToManyParsers, $objects, $included, $useCache) |
|
static | _initRelationFields ($included, $metaDatas, &$invertedJoinColumns, &$oneToManyFields, &$manyToManyFields) |
|
static | _getIncludedForStep ($included) |
|
static | _getFieldList ($tableName, $metaDatas) |
|
static | _loadObjectFromRow (Database $db, $row, $className, $invertedJoinColumns, &$manyToOneQueries, $oneToManyFields, $manyToManyFields, &$oneToManyQueries, &$manyToManyParsers, $memberNames, $accessors, $transformers, $primaryKeys) |
|
static | _loadSimpleObjectFromRow (Database $db, $row, $className, $memberNames, $transformers) |
|
static | storeDbCache (string $model) |
|
static | getModels ($dbOffset='default') |
|
static | remove ($instance) |
| Deletes the object $instance from the database.
|
|
static | deleteAll ($modelName, $where, $params=[]) |
| Deletes all instances from $modelName matching the condition $where.
|
|
static | deleteAllChildren (object $instance) |
|
static | updateAll (string $modelName, array $values, string $condition, array $params) |
| Mass update for $modelName matching the condition $where, with an associative array of $values.
|
|
static | delete ($modelName, $ids) |
| Deletes all instances from $modelName corresponding to $ids.
|
|
static | deleteById ($modelName, $id) |
|
static | insert ($instance, $insertMany=false) |
| Inserts a new instance $instance into the database.
|
|
static | insertOrUpdateAllManyToMany ($instance) |
| Updates manyToMany members.
|
|
static | insertOrUpdateManyToMany ($instance, $member) |
| Updates the $member member of $instance annotated by a ManyToMany.
|
|
static | updateGroup ($instances, $updateMany=false) |
| Updates an array of $instances in the database.
|
|
static | save ($instance, $updateMany=false) |
|
static | _getIncludedForStep ($included) |
|
static | _initRelationFields ($included, $metaDatas, &$invertedJoinColumns, &$oneToManyFields, &$manyToManyFields) |
|
static | getManyToOne ($instance, $member, $included=false, $useCache=NULL) |
| Loads member associated with $instance by a ManyToOne relationship.
|
|
static | getOneToMany ($instance, $member, $included=true, $useCache=NULL, $annot=null) |
| Assign / load the child records in the $member member of $instance.
|
|
static | getManyToMany ($instance, $member, $included=false, $array=null, $useCache=NULL) |
| Assigns / loads the child records in the $member member of $instance.
|
|
static | affectsManyToManys ($instance, $array=NULL, $useCache=NULL) |
|
static | _affectsRelationObjects ($className, $classPropKey, $manyToOneQueries, $oneToManyQueries, $manyToManyParsers, $objects, $included, $useCache) |
|
static | uGetAll ($className, $ucondition='', $included=true, $parameters=null, $useCache=null) |
| Returns an array of $className objects from the database.
|
|
static | uCount ($className, $ucondition='', $parameters=null) |
| Returns the number of objects of $className from the database respecting the condition possibly passed as parameter.
|
|
static | uAggregate (string $className, string $ucondition='', ?array $parameters=null, ?array $groupBy=null, string $function='COUNT', string $field=' *', bool $distinct=false) |
|
static | uCountGroupBy (string $className, string $ucondition='', ?array $parameters=null, ?array $groupBy=null, string $countField=' *', bool $distinct=false) |
|
static | uAvgGroupBy (string $className, string $avgField, string $ucondition='', ?array $parameters=null, ?array $groupBy=null) |
|
static | uSumGroupBy (string $className, string $sumField, string $ucondition='', ?array $parameters=null, ?array $groupBy=null) |
|
static | uMinGroupBy (string $className, string $minField, string $ucondition='', ?array $parameters=null, ?array $groupBy=null) |
|
static | uMaxGroupBy (string $className, string $maxField, string $ucondition='', ?array $parameters=null, ?array $groupBy=null) |
|
static | uGetOne ($className, $ucondition, $included=true, $parameters=null, $useCache=null) |
| Returns an instance of $className from the database, from $keyvalues values of the primary key.
|
|
static | beginTransaction ($offset='default') |
| Initiates a transaction.
|
|
static | commit ($offset='default') |
| Commits a transaction.
|
|
static | commitToLevel ($transactionLevel, $offset='default') |
| Commits nested transactions up to level $transactionLevel.
|
|
static | commitAll ($offset='default') |
| Commits all nested transactions (up to level 0)
|
|
static | rollBack ($offset='default') |
| Rolls back a transaction.
|
|
static | rollBackToLevel ($transactionLevel, $offset='default') |
| Rolls back nested transactions up to level $transactionLevel.
|
|
static | rollBackAll ($offset='default') |
| Rolls back all nested transactions (up to level 0)
|
|
static | callInTransaction ($callback, $offset,... $parameters) |
| Call a callback with an array of parameters in a transaction.
|
|
static | setIsolationLevel (string $offset='default', $isolationLevel='READ COMMITTED') |
| Sets the isolation level for transactions.
|
|
static | initPooling (&$config, $offset=null, int $size=16) |
| Initialize pooling (To invoke during Swoole startup)
|
|
static | pool ($offset='default') |
| gets a new DbConnection from pool
|
|
static | freePool ($db) |
|
static | go ($asyncCallable, $offset='default') |
|
static | toInsert ($instance) |
| Adds an instance in the bulk list of objects to insert.
|
|
static | toInserts (array $instances) |
| Adds an array of instances in the bulk list of objects to insert.
|
|
static | flushInserts () |
| Executes all waiting insert operations.
|
|
static | toUpdate ($instance) |
| Adds an instance in the bulk list of objects to update.
|
|
static | toUpdates (array $instances) |
| Adds an array of instances in the bulk list of objects to update.
|
|
static | updateGroups ($count=5) |
|
static | insertGroups ($count=5) |
|
static | deleteGroups ($count=5) |
|
static | flushUpdates () |
| Executes all waiting update operations.
|
|
static | toDelete ($instance) |
| Adds an instance in the bulk list of objects to delete.
|
|
static | toDeletes (array $instances) |
| Adds an array of instances in the bulk list of objects to delete.
|
|
static | flushDeletes () |
| Executes all waiting delete operations.
|
|
static | flush () |
| Executes all waiting operations (inserts, updates, deletes)
|
|
static | clearBulks (?array $operations=null, ?array $classes=null) |
| Clear bulk and clear instances waiting for operations.
|
|
static | countInstancesBulk (string $class, string $operation='update') |
| Return the count of instances waiting for flushing in a bulk.
|
|
static | prepareGetById ($name, $className, $included=false, $cache=null) |
|
static | prepareGetOne ($name, $className, $condition='', $included=false, $cache=null) |
|
static | prepareGetAll ($name, $className, $condition='', $included=false, $cache=null) |
|
static | executePrepared ($name, $params=[], $useCache=false) |
|
static | storeDbCachePrepared ($name) |
|
static | getPrepared (string $name) |
| Returns the daoPreparedQuery corresponding to a name.
|
|
|
static | _getOne (Database $db, $className, ConditionParser $conditionParser, $included, $useCache) |
|
static | _getAll (Database $db, $className, ConditionParser $conditionParser, $included=true, $useCache=NULL) |
|
static | getConditionParser ($className, $keyValues) |
|
static | prepareManyToMany ($db, &$ret, $instance, $member, $annot=null) |
|
static | prepareManyToOne (&$ret, $instance, $value, $fkField, $annotationArray) |
|
static | prepareOneToMany (&$ret, $instance, $member, $annot=null) |
|
static | getClass_ ($instance) |
|
static | getInstance_ ($instance) |
|
static | getValue_ ($instance, $member) |
|
static | getFirstKeyValue_ ($instance) |
|
static | applyTransformers ($transformers, &$row, $memberNames) |
|
static | loadManys ($o, $db, $oneToManyFields, &$oneToManyQueries, $manyToManyFields, &$manyToManyParsers) |
|
static | deleteManyToManyChildren (object $instance, string $memberName) |
|
static | deleteOneToManyChildren (object $instance, string $memberName) |
|
static | prepareManyToMany ($db, &$ret, $instance, $member, $annot=null) |
| Prepares members associated with $instance with a ManyToMany type relationship.
|
|
static | prepareOneToMany (&$ret, $instance, $member, $annot=null) |
| Prepares members associated with $instance with a oneToMany type relationship.
|
|
static | prepareManyToOne (&$ret, $instance, $value, $fkField, $annotationArray) |
| Prepares members associated with $instance with a manyToOne type relationship.
|
|
static | setToMember ($member, $instance, $value, $accessor) |
|
static | getAccessor ($member, $instance, $part) |
|
static | uParse ($db, $className, &$ucondition, $quote, &$fields=null) |
|
static | uParseExpression ($db, $className, $expression, &$expressionArray, &$condition, &$ucondition, &$aliases, $quote, &$fields=null) |
|
static | getAnnotFieldsInRelations ($className) |
|
static | uGetExpressions ($condition) |
|
static | getBulk ($class, $operation='update') |
|
static | toOperation ($instance, string $operation) |
|
static | toOperations (array $instances, string $operation) |
|