Beispiel #1
0
 /**
  * @param int $iUserId
  * @param int $iSortField
  * @param int $iSortOrder
  * @param int $iOffset
  * @param int $iRequestLimit
  * @param string $sSearch
  * @param string $sFirstCharacter
  * @param int $iGroupId
  * @param int $iSharedTenantId = null
  * @param bool $bAll = false
  * @return bool|array
  */
 public function getContactItems($iUserId, $iSortField, $iSortOrder, $iOffset, $iRequestLimit, $sSearch, $sFirstCharacter, $iGroupId, $iSharedTenantId = null, $bAll = false)
 {
     $mContactItems = false;
     $mItsMeTypeId = null;
     if (0 < $iGroupId) {
         $oGContact = $this->GetMyGlobalContact($iUserId);
         $mItsMeTypeId = $oGContact ? $oGContact->IdContact : null;
     }
     if ($bAll) {
         $mItsMeTypeId = $iUserId;
     }
     if ($this->oConnection->Execute($this->oCommandCreator->getContactItems($iUserId, $iSortField, $iSortOrder, $iOffset, $iRequestLimit, $sSearch, $sFirstCharacter, $iGroupId, $iSharedTenantId, $bAll))) {
         $mContactItems = array();
         while (false !== ($oRow = $this->oConnection->GetNextRecord())) {
             $oContactItem = new CContactListItem();
             $oContactItem->InitByDbRowWithType('contact', $oRow, $mItsMeTypeId);
             $mContactItems[] = $oContactItem;
             unset($oContactItem);
         }
     }
     return $mContactItems;
 }