190 if (isset ($cache)) {
191 $this->db->setCacheInstance($cache);
196 $this->tableName = $metaDatas [
'#tableName'];
197 $this->hasIncluded = $this->included || (\is_array($this->included) && \count($this->included) > 0);
198 if ($this->hasIncluded) {
199 DAO::_initRelationFields($this->included, $metaDatas, $this->invertedJoinColumns, $this->oneToManyFields, $this->manyToManyFields);
203 $this->memberList = \array_flip(\array_diff($metaDatas [
'#fieldNames'], $metaDatas [
'#notSerializable']));
209 $this->accessors = $metaDatas [
'#accessors'];
214 $this->preparedCondition = SqlUtils::checkWhere($this->conditionParser->getCondition());
215 $this->statement = $this->db->getDaoPreparedStatement($this->tableName, $this->preparedCondition, $this->fieldList . $this->sqlAdditionalMembers);
219 if ($this->additionalMembers) {
226 return \implode(
',', $this->additionalMembers);
230 foreach ($this->additionalMembers as $member => $_) {
231 $object->{$member} = $row [$member] ??
null;
232 $object->_rest [$member] = $row [$member] ??
null;
236 abstract public function execute($params = [], $useCache =
false);
244 public function addMember(
string $sqlExpression,
string $memberName): void {
245 $this->additionalMembers [$memberName] = $sqlExpression .
" AS '{$memberName}'";
246 $this->updateSqlAdditionalMembers();
255 foreach ($expressionsNames as $member => $expression) {
256 $this->additionalMembers [$member] = $expression .
" AS '{$member}'";
258 $this->updateSqlAdditionalMembers();
265 $this->db->storeCache();
Abstract class for database caching Ubiquity\cache\database$DbCache This class is part of Ubiquity.
Gateway class between database and object model.
Object/relational mapping utilities.
static hasAllMembersPublic($className)
static getPrimaryKeys($className)
static getModelMetadata($className)
Ubiquity\orm\core\prepared$DAOPreparedQuery This class is part of Ubiquity.
storeDbCache()
Store the cache for a prepared Query.
addMembers(array $expressionsNames)
Adds new expressions and their associated members at runtime.
execute($params=[], $useCache=false)
updateSqlAdditionalMembers()
__construct($className, $condition=null, $included=false, $cache=null)
addMember(string $sqlExpression, string $memberName)
Adds a new expression and associates it with a new member of the class added at runtime.
prepare(?DbCache $cache=null)
addAditionnalMembers($object, $row)
Represents a query condition.
static _getIncludedForStep($included)
static _getFieldList($tableName, $metaDatas)
static _initRelationFields($included, $metaDatas, &$invertedJoinColumns, &$oneToManyFields, &$manyToManyFields)
static getPropKeys($class)
static getFirstPropKey($class)