snappymail/rainloop/v/1.3.10.490/app/libraries/RainLoop/Providers/Suggestions.php
RainLoop Team 0b7afb5b7b + Multiple identities (#9)
- animation settings
* minor fixes
2013-11-12 02:01:44 +04:00

40 lines
No EOL
876 B
PHP

<?php
namespace RainLoop\Providers;
class Suggestions extends \RainLoop\Providers\AbstractProvider
{
/**
* @var \RainLoop\Providers\Suggestions\SuggestionsInterface
*/
private $oDriver;
/**
* @param \RainLoop\Providers\Suggestions\SuggestionsInterface|null $oDriver = null
*
* @return void
*/
public function __construct($oDriver = null)
{
$this->oDriver = $oDriver;
}
/**
* @param \RainLoop\Account $oAccount
* @param string $sQuery
*
* @return array
*/
public function Process(\RainLoop\Account $oAccount, $sQuery)
{
return $this->oDriver && $this->IsActive() && 0 < \strlen($sQuery) ? $this->oDriver->Process($oAccount, $sQuery) : array();
}
/**
* @return bool
*/
public function IsActive()
{
return $this->oDriver instanceof \RainLoop\Providers\Suggestions\SuggestionsInterface;
}
}