. */ /** * Doctrine_Template_Searchable * * @author Konsta Vesterinen * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ * @link www.phpdoctrine.com * @since 1.0 */ class Doctrine_Template_Searchable extends Doctrine_Template { public function __construct(array $options) { $this->_plugin = new Doctrine_Search($options); } public function getPlugin() { return $this->_plugin; } public function setUp() { $id = $this->_table->getIdentifier(); $this->_plugin->buildPluginDefinition($this->_table); $this->hasMany($this->_plugin->getOption('className'), array('local' => $id, 'foreign' => $id)); $this->addListener(new Doctrine_Search_Listener($this->_plugin)); } public function batchUpdateIndex($limit = null, $offset = null) { $this->_plugin->batchUpdateIndex($limit, $offset); } }