2014-11-21 15:25:40 +01:00
|
|
|
<?php
|
2015-03-11 04:30:10 +01:00
|
|
|
|
2014-11-21 15:25:40 +01:00
|
|
|
/**
|
|
|
|
* This file is part of the FOSElasticaBundle project.
|
|
|
|
*
|
|
|
|
* (c) FriendsOfSymfony <https://github.com/FriendsOfSymfony/FOSElasticaBundle/graphs/contributors>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace FOS\ElasticaBundle\Event;
|
|
|
|
|
|
|
|
/**
|
2015-03-12 11:45:24 +01:00
|
|
|
* Index Populate Event.
|
2014-11-21 15:25:40 +01:00
|
|
|
*
|
|
|
|
* @author Oleg Andreyev <oleg.andreyev@intexsys.lv>
|
|
|
|
*/
|
2015-03-13 09:34:56 +01:00
|
|
|
class IndexPopulateEvent extends IndexEvent
|
2014-11-21 15:25:40 +01:00
|
|
|
{
|
|
|
|
const PRE_INDEX_POPULATE = 'elastica.index.index_pre_populate';
|
|
|
|
const POST_INDEX_POPULATE = 'elastica.index.index_post_populate';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
private $reset;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
private $options;
|
|
|
|
|
|
|
|
/**
|
2015-03-12 11:45:24 +01:00
|
|
|
* @param string $index
|
|
|
|
* @param boolean $reset
|
|
|
|
* @param array $options
|
2014-11-21 15:25:40 +01:00
|
|
|
*/
|
2015-03-11 04:11:18 +01:00
|
|
|
public function __construct($index, $reset, $options)
|
2014-11-21 15:25:40 +01:00
|
|
|
{
|
2015-03-13 09:34:56 +01:00
|
|
|
parent::__construct($index);
|
|
|
|
|
2014-11-21 15:25:40 +01:00
|
|
|
$this->reset = $reset;
|
|
|
|
$this->options = $options;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function isReset()
|
|
|
|
{
|
|
|
|
return $this->reset;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getOptions()
|
|
|
|
{
|
|
|
|
return $this->options;
|
|
|
|
}
|
2015-03-11 04:30:10 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param boolean $reset
|
|
|
|
*/
|
|
|
|
public function setReset($reset)
|
|
|
|
{
|
|
|
|
$this->reset = $reset;
|
|
|
|
}
|
2014-11-21 15:25:40 +01:00
|
|
|
}
|