Skip to content
Snippets Groups Projects
Commit 85732a1e authored by David Surville's avatar David Surville
Browse files

Merge branch 'release-3.0.0'

parents 7eb0e090 c6b89c16
No related branches found
No related tags found
No related merge requests found
...@@ -180,7 +180,7 @@ class ZimbraAccountService extends AbstractService ...@@ -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 string|AccountEntity $value nom du compte ou objet AccountEntity
* @param array $params * @param array $params
...@@ -233,7 +233,7 @@ class ZimbraAccountService extends AbstractService ...@@ -233,7 +233,7 @@ class ZimbraAccountService extends AbstractService
} }
/** /**
* Supprimer un compte * Supprime un compte
* *
* @param AccountEntity|string $id * @param AccountEntity|string $id
* @return bool * @return bool
...@@ -330,7 +330,7 @@ class ZimbraAccountService extends AbstractService ...@@ -330,7 +330,7 @@ class ZimbraAccountService extends AbstractService
/** /**
* Supprimer un alias de messagerie * Supprime un alias de messagerie
* *
* @param string|AccountEntity $id * @param string|AccountEntity $id
* @param string $alias * @param string $alias
...@@ -385,7 +385,7 @@ class ZimbraAccountService extends AbstractService ...@@ -385,7 +385,7 @@ class ZimbraAccountService extends AbstractService
} }
/** /**
* Supprimer une adresse de redirection * Supprime une adresse de redirection
* *
* @param string|AccountEntity $id * @param string|AccountEntity $id
* @param string $forward * @param string $forward
...@@ -408,4 +408,39 @@ class ZimbraAccountService extends AbstractService ...@@ -408,4 +408,39 @@ class ZimbraAccountService extends AbstractService
return $this; 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment