Added \RainLoop\Api::ClearUserData() function

This commit is contained in:
RainLoop Team 2014-08-14 00:40:56 +04:00
parent 290cf38b97
commit 9a30680748
11 changed files with 363 additions and 279 deletions

View file

@ -1,52 +1,62 @@
<?php
namespace RainLoop\Providers;
class Settings extends \RainLoop\Providers\AbstractProvider
{
/**
* @var \RainLoop\Providers\Settings\SettingsInterface
*/
private $oDriver;
/**
* @param \RainLoop\Providers\Settings\SettingsInterface $oDriver
*
* @return void
*/
public function __construct(\RainLoop\Providers\Settings\SettingsInterface $oDriver)
{
$this->oDriver = $oDriver;
}
/**
* @param \RainLoop\Account $oAccount
*
* @return \RainLoop\Settings
*/
public function Load(\RainLoop\Account $oAccount)
{
$oSettings = new \RainLoop\Settings();
$oSettings->InitData($this->oDriver->Load($oAccount));
return $oSettings;
}
/**
* @param \RainLoop\Account $oAccount
* @param \RainLoop\Settings $oSettings
*
* @return bool
*/
public function Save(\RainLoop\Account $oAccount, \RainLoop\Settings $oSettings)
{
return $this->oDriver->Save($oAccount, $oSettings->DataAsArray());
}
/**
* @return bool
*/
public function IsActive()
{
return $this->oDriver instanceof \RainLoop\Providers\Settings\SettingsInterface;
}
}
<?php
namespace RainLoop\Providers;
class Settings extends \RainLoop\Providers\AbstractProvider
{
/**
* @var \RainLoop\Providers\Settings\SettingsInterface
*/
private $oDriver;
/**
* @param \RainLoop\Providers\Settings\SettingsInterface $oDriver
*
* @return void
*/
public function __construct(\RainLoop\Providers\Settings\SettingsInterface $oDriver)
{
$this->oDriver = $oDriver;
}
/**
* @param \RainLoop\Account $oAccount
*
* @return \RainLoop\Settings
*/
public function Load(\RainLoop\Account $oAccount)
{
$oSettings = new \RainLoop\Settings();
$oSettings->InitData($this->oDriver->Load($oAccount));
return $oSettings;
}
/**
* @param \RainLoop\Account $oAccount
* @param \RainLoop\Settings $oSettings
*
* @return bool
*/
public function Save(\RainLoop\Account $oAccount, \RainLoop\Settings $oSettings)
{
return $this->oDriver->Save($oAccount, $oSettings->DataAsArray());
}
/**
* @param string $sEmail
*
* @return bool
*/
public function ClearByEmail($sEmail)
{
return $this->oDriver->ClearByEmail($sEmail);
}
/**
* @return bool
*/
public function IsActive()
{
return $this->oDriver instanceof \RainLoop\Providers\Settings\SettingsInterface;
}
}