Пример #1
0
 /**
  * @param	array		$counts			array(contact_count, group_count)
  * @param	int			$page
  * @param	string		$sortField
  * @param	int			$sortOrder
  * @param	int			$groupId
  * @param	int			$lookForType
  * @param	string		$lookForField
  * @return	ContactCollection
  */
 public function GetContactsAndGroups($counts, $page, $sortField, $sortOrder, $groupId, $lookForType, $lookForField)
 {
     $contacts = null;
     $countContactsAndGroups = $counts[0] + $counts[1];
     if ($countContactsAndGroups < ($page - 1) * $this->_account->ContactsPerPage) {
         $page = 1;
     }
     if ($lookForField === '') {
         $contacts =& $this->_db->LoadContactsAndGroups($page, $sortField, $sortOrder);
     } else {
         if ($countContactsAndGroups > 0) {
             $contacts =& $this->_db->SearchContactsAndGroups($page, $lookForField, $groupId, $sortField, $sortOrder, $lookForType);
         }
     }
     return $contacts;
 }