Loading src/UnicaenZimbra/Service/ZimbraAccountService.php +39 −4 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ class ZimbraAccountService extends AbstractService } /** * Créé un nouveau compte * Crée un nouveau compte * * @param string|AccountEntity $value nom du compte ou objet AccountEntity * @param array $params Loading Loading @@ -233,7 +233,7 @@ class ZimbraAccountService extends AbstractService } /** * Supprimer un compte * Supprime un compte * * @param AccountEntity|string $id * @return bool Loading Loading @@ -330,7 +330,7 @@ class ZimbraAccountService extends AbstractService /** * Supprimer un alias de messagerie * Supprime un alias de messagerie * * @param string|AccountEntity $id * @param string $alias Loading Loading @@ -385,7 +385,7 @@ class ZimbraAccountService extends AbstractService } /** * Supprimer une adresse de redirection * Supprime une adresse de redirection * * @param string|AccountEntity $id * @param string $forward Loading @@ -408,4 +408,39 @@ class ZimbraAccountService extends AbstractService return $this; } /** * Change l'adresse mail principale du compte * NB : l'ancien nom est conservé comme alias * * @param string|AccountEntity $id * @param string $newName * @return AccountEntity * @throws \UnicaenZimbra\Exception */ public function changePrimaryEmail($id, $newName): AccountEntity { if ($id instanceof AccountEntity) { $aid = $id->getId(); $account = $id; } else { $aid = $id; $account = new AccountEntity; } $params = array( 'account' => array( '@content' => $aid, '@attributes' => array('by' => 'id') ), 'newName' => $newName ); $response = $this->getZimbra()->request('ChangePrimaryEmailRequest', [], $params); $accounts = $response->children()->ChangePrimaryEmailResponse->children(); $account->populate($accounts[0]); $this->count = 1; return $account; } } No newline at end of file Loading
src/UnicaenZimbra/Service/ZimbraAccountService.php +39 −4 Original line number Diff line number Diff line Loading @@ -180,7 +180,7 @@ class ZimbraAccountService extends AbstractService } /** * Créé un nouveau compte * Crée un nouveau compte * * @param string|AccountEntity $value nom du compte ou objet AccountEntity * @param array $params Loading Loading @@ -233,7 +233,7 @@ class ZimbraAccountService extends AbstractService } /** * Supprimer un compte * Supprime un compte * * @param AccountEntity|string $id * @return bool Loading Loading @@ -330,7 +330,7 @@ class ZimbraAccountService extends AbstractService /** * Supprimer un alias de messagerie * Supprime un alias de messagerie * * @param string|AccountEntity $id * @param string $alias Loading Loading @@ -385,7 +385,7 @@ class ZimbraAccountService extends AbstractService } /** * Supprimer une adresse de redirection * Supprime une adresse de redirection * * @param string|AccountEntity $id * @param string $forward Loading @@ -408,4 +408,39 @@ class ZimbraAccountService extends AbstractService return $this; } /** * Change l'adresse mail principale du compte * NB : l'ancien nom est conservé comme alias * * @param string|AccountEntity $id * @param string $newName * @return AccountEntity * @throws \UnicaenZimbra\Exception */ public function changePrimaryEmail($id, $newName): AccountEntity { if ($id instanceof AccountEntity) { $aid = $id->getId(); $account = $id; } else { $aid = $id; $account = new AccountEntity; } $params = array( 'account' => array( '@content' => $aid, '@attributes' => array('by' => 'id') ), 'newName' => $newName ); $response = $this->getZimbra()->request('ChangePrimaryEmailRequest', [], $params); $accounts = $response->children()->ChangePrimaryEmailResponse->children(); $account->populate($accounts[0]); $this->count = 1; return $account; } } No newline at end of file