Ejemplo n.º 1
0
 /**
  * Return list of archived companies
  *
  * @param User $user
  * @param integer $page
  * @param integer $per_page
  * @return array
  */
 function paginateArchived($user, $page = 1, $per_page = 30)
 {
     $visible_ids = $user->visibleCompanyIds();
     if (is_foreachable($visible_ids)) {
         return Companies::paginate(array('conditions' => array('is_archived = ? AND id IN (?)', true, $visible_ids), 'order' => 'is_owner DESC, name'), $page, $per_page);
     } else {
         return array(null, new Pager(1, 0, $per_page));
     }
     // if
 }