Ejemplo n.º 1
0
 /**
  *
  */
 public static function getStringListOfUserForOrderList()
 {
     $safeinstance = new SafinstancesUsers();
     $safeinstanceSelector = $safeinstance->select()->from($safeinstance->getTableName(), 'users_id as id')->where('safinstances_id = ' . Sydney_Tools::getSafinstancesId());
     $safeinstanceResult = $safeinstance->fetchAll($safeinstanceSelector)->toArray();
     $listUsers = Sydney_Tools::implode(', ', $safeinstanceResult);
     $users = new Users();
     $usersSelector = $users->select()->from($users->getTableName(), 'id')->where('id NOT IN (' . $listUsers . ')')->where('safinstances_id = ' . Sydney_Tools::getSafinstancesId());
     $usersResult = $users->fetchAll($usersSelector)->toArray();
     if (count($usersResult) > 0) {
         if (!empty($listUsers)) {
             $listUsers .= ', ';
         }
         $listUsers .= Sydney_Tools::implode(', ', $usersResult);
     }
     return $listUsers;
 }
Ejemplo n.º 2
0
 /**
  *
  * delete all contents of page $pageid
  * @param $pageId        id of the pagstructure
  * @param $rollback        determine if the content are deleted or restored
  */
 public function deleteContentFromPage($pageId, $rollback = false)
 {
     // search all content from page
     $PageDiv = new PagstructurePagdivs();
     $selector = $PageDiv->select()->from(Sydney_Tools::getTableName($PageDiv), 'pagdivs_id')->where('pagstructure_id = ' . $pageId);
     $rowset = $PageDiv->fetchAll($selector)->toArray();
     $listContentId = Sydney_Tools::implode(',', $rowset);
     // delete content
     if (!empty($listContentId)) {
         if ($this->isLogicalDelete()) {
             return $this->update(array('isDeleted' => !$rollback), 'id IN (' . $listContentId . ')');
         } else {
             return $this->delete('id IN (' . $listContentId . ')');
         }
     }
     return false;
 }