Example #1
0
 /**
  * @param CAccount $oAccount
  * @return bool
  */
 public function ClearAllContactsAndGroups($oAccount)
 {
     $bResult = true;
     if ($oAccount && $oAccount->IsDefaultAccount) {
         $iUserId = $oAccount->IdUser;
         $bResult &= $this->oConnection->Execute($this->oCommandCreator->DeleteAllGroupsContacts($iUserId));
         $bResult &= $this->oConnection->Execute($this->oCommandCreator->DeleteAllContacts($iUserId));
         $bResult &= $this->oConnection->Execute($this->oCommandCreator->DeleteAllGroups($iUserId));
         $bResult &= $this->oConnection->Execute($this->oCommandCreator->DeleteUserGlobalSubContact($iUserId));
         $bResult &= $this->oConnection->Execute($this->oCommandCreator->DeleteUserGlobalContact($iUserId));
     }
     return (bool) $bResult;
 }