Пример #1
0
 /**
  * @param Folder $folder
  * @param bool $useCache = false
  */
 function GetFolderInfo(&$folder, $useCache = false)
 {
     if ($folder) {
         $row = null;
         $_sql = $this->_commandCreator->GetFolderInfo($folder);
         $_cacher =& CObjectCache::CreateInstance();
         if ($useCache && $_cacher->Has('sql=' . $_sql)) {
             $row =& $_cacher->Get('sql=' . $_sql);
         } else {
             if ($this->_dbConnection->Execute($_sql)) {
                 $row = $this->_dbConnection->GetNextRecord();
                 @$this->_dbConnection->FreeResult();
                 $_cacher->Set('sql=' . $_sql, $row);
             }
         }
         if ($row) {
             $folder->FullName = substr($row->full_path, 0, -1);
             $folder->Name = substr($row->name, 0, -1);
             $folder->Type = $row->type;
             $folder->SyncType = $row->sync_type;
             $folder->Hide = (bool) abs($row->hide);
             $folder->FolderOrder = (int) $row->fld_order;
             $folder->IdParent = (int) $row->id_parent;
             return true;
         }
     }
     return false;
 }
Пример #2
0
 /**
  * @param Folder $folder
  */
 function GetFolderInfo(&$folder)
 {
     if (!$folder || !$this->_dbConnection->Execute($this->_commandCreator->GetFolderInfo($folder))) {
         return;
     }
     if ($row = $this->_dbConnection->GetNextRecord()) {
         $folder->FullName = substr($row->full_path, 0, -1);
         $folder->Name = substr($row->name, 0, -1);
         $folder->Type = $row->type;
         $folder->SyncType = $row->sync_type;
         $folder->Hide = (bool) abs($row->hide);
         $folder->FolderOrder = (int) $row->fld_order;
         $folder->IdParent = (int) $row->id_parent;
     }
 }