Ejemplo n.º 1
0
 /**
  * getter na records
  * @return AbstractRecords
  */
 public function getRecords()
 {
     try {
         if ($this->records instanceof AbstractRecords || $this->records instanceof LBoxPagingIterator) {
             return $this->records;
         }
         if (strlen($this->classNameRecord) < 1) {
             throw new LBoxExceptionPage(LBoxExceptionPage::MSG_INSTANCE_VAR_STRING_NOTNULL, LBoxExceptionPage::CODE_BAD_INSTANCE_VAR);
         }
         $classNameRecords = eval("return " . $this->classNameRecord . "::\$itemsType;");
         if (is_numeric($this->pageItems) && $this->pageItems > 0) {
             $this->records = new LBoxPagingIteratorRecords($classNameRecords, $this->pageItems, $this->classNameRecordOutputFilter, $this->filter, $this->orderBy, $this->limit, $this->where);
         } else {
             $this->records = new $classNameRecords($this->filter, $this->orderBy, $this->limit, $this->where);
             if (strlen($this->classNameRecordOutputFilter) > 0) {
                 $this->records->setOutputFilterItemsClass($this->classNameRecordOutputFilter);
             }
         }
         /*DbControl::$debug	= true;
         $this->records->count();
         DbControl::$debug	= false;*/
         return $this->records;
     } catch (Exception $e) {
         throw $e;
     }
 }
Ejemplo n.º 2
0
 protected function getWhere()
 {
     try {
         do {
             $itemType = $this->getClassVar("itemType");
             $treeColNames = eval("return {$itemType}::\$treeColNames;");
             $pidColName = $treeColNames[2];
             if (!$this->isTree()) {
                 break;
             }
             if (array_key_exists($pidColName, (array) $this->filter)) {
                 break;
             }
             if (!$this->whereAdd instanceof QueryBuilderWhere) {
                 $this->whereAdd = new QueryBuilderWhere();
             }
             $this->whereAdd->addConditionColumn($pidColName, 0);
             $this->whereAdd->addConditionColumn($pidColName, "<<NULL>>", 0, 1);
             //$this->whereAdd .= "AND ($pidColName=0 OR $pidColName IS NULL)";
         } while (false);
         return parent::getWhere();
     } catch (Exception $e) {
         throw $e;
     }
 }
Ejemplo n.º 3
0
 /**
  * pretizeno o mazani front cache
  */
 public function clearCache()
 {
     try {
         $recordClass = $this->getClassVar("itemType");
         $forceCleanForAllXTUsers = eval("return {$recordClass}::\$frontCacheForceCleanForAllXTUsers;");
         LBoxCacheManagerFront::getInstance()->cleanByRecordType($recordClass, $forceCleanForAllXTUsers);
         return parent::clearCache();
     } catch (Exception $e) {
         throw $e;
     }
 }