Example #1
0
 /**
  * @param \RainLoop\Account $oAccount
  * @param array $aAccounts = array()
  *
  * @return array
  */
 public function SetAccounts($oAccount, $aAccounts = array())
 {
     $sParentEmail = $oAccount->ParentEmailHelper();
     if (!\is_array($aAccounts) || 0 >= \count($aAccounts) || 1 === \count($aAccounts) && !empty($aAccounts[$sParentEmail])) {
         $this->StorageProvider()->Clear(null, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\KeyPathHelper::WebmailAccounts($sParentEmail));
     } else {
         $this->StorageProvider()->Put(null, \RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY, \RainLoop\KeyPathHelper::WebmailAccounts($sParentEmail), @\serialize($aAccounts));
     }
 }