/** * Метод возвращает видимые пользователю объекты из базы */ public function getVisibleObjects(FoldedResources $folded, $objName, array $visibleIdents) { $folded->assertWorkWithTable(); $cacheKey = $folded->getUnique("visible-{$objName}"); if (!$this->CACHE->has($cacheKey)) { $view = $folded->getTableView(); $colIdent = $folded->getTableColumnIdent(); $colStype = $folded->getTableColumnStype(); $where = array(); if ($colStype) { $where[$colStype] = $folded->getFoldingSubType(); } $this->CACHE->set($cacheKey, $this->getArray(Query::select('*', $view, $where), null, ObjectQueryFetcher::inst($objName, $colIdent)->setIncludeKeys($visibleIdents))); } return $this->CACHE->get($cacheKey); }
protected function getObject($query, $inputarr, $objName, array $constructorParams = null, $required = true) { return $this->getArray($query, $inputarr, ObjectQueryFetcher::inst($objName, null, $constructorParams, $required ? ObjectQueryFetcher::FETCH_TYPE_RECORD : ObjectQueryFetcher::FETCH_TYPE_RECORD_OR_NULL)); }