New logic for storage provider (breaking changes)

This commit is contained in:
RainLoop Team 2015-02-05 03:54:26 +04:00
parent 44566aad4b
commit 51666d7c7e
19 changed files with 453 additions and 297 deletions

View file

@ -18,15 +18,15 @@ class Storage extends \RainLoop\Providers\AbstractProvider
}
/**
* @param \RainLoop\Model\Account|string|null $oAccount
* @param \RainLoop\Model\Account|string|null $mAccount
* @param int $iStorageType
*
* @return bool
*/
public function verifyAccount($oAccount, $iStorageType)
private function verifyAccount($mAccount, $iStorageType)
{
if (\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY !== $iStorageType &&
!($oAccount instanceof \RainLoop\Model\Account || \is_string($oAccount)))
!($mAccount instanceof \RainLoop\Model\Account || \is_string($mAccount)))
{
return false;
}
@ -83,10 +83,20 @@ class Storage extends \RainLoop\Providers\AbstractProvider
{
return false;
}
return $this->oDriver->Clear($oAccount, $iStorageType, $sKey);
}
/**
* @param \RainLoop\Model\Account|string $oAccount
*
* @return bool
*/
public function DeleteStorage($oAccount)
{
return $this->oDriver->DeleteStorage($oAccount);
}
/**
* @return bool
*/
@ -94,4 +104,13 @@ class Storage extends \RainLoop\Providers\AbstractProvider
{
return $this->oDriver instanceof \RainLoop\Providers\Storage\StorageInterface;
}
/**
* @return bool
*/
public function IsLocal()
{
return $this->oDriver instanceof \RainLoop\Providers\Storage\StorageInterface &&
$this->oDriver->IsLocal();
}
}