Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
maxiloc committed Aug 6, 2015
2 parents 8730939 + 157a0a3 commit a213558
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Command/ReindexCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
{
$toReindex = [];

if ($input->hasArgument('entityName')) {
if ($input->getArgument('entityName')) {
$filter = $this->getEntityManager()->getRepository($input->getArgument('entityName'))->getClassName();
} else {
$filter = null;
Expand Down
15 changes: 14 additions & 1 deletion Indexer/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,24 @@ class Indexer
* The arrays below hold the entities we will sync with
* Algolia on postFlush.
*/

// holds either naked entities or arrays of the form [
// 'entity' => $someEntity,
// 'indexName' => 'index name to override where the entity should normally go'
// ]
<<<<<<< HEAD
protected $entitiesScheduledForCreation = array();

// holds arrays like ['entity' => $entity, 'changeSet' => $changeSet]
protected $entitiesScheduledForUpdate = array();

=======
private $entitiesScheduledForCreation = array();

// holds arrays like ['entity' => $entity, 'changeSet' => $changeSet]
private $entitiesScheduledForUpdate = array();

>>>>>>> 157a0a3136dfd468a20c31901f5aeb969799c577
// holds arrays like ['objectID' => 'aStringID', 'index' => 'anIndexName']
protected $entitiesScheduledForDeletion = array();

Expand Down Expand Up @@ -138,6 +146,11 @@ public function discoverEntity($entity_or_class, EntityManager $em)
$class = $this->get_class($entity);
} else {
$class = $em->getRepository($entity_or_class)->getClassName();
$reflClass = new \ReflectionClass($class);

if ($reflClass->isAbstract()) {
return false;
}
$entity = new $class();
}

Expand Down

0 comments on commit a213558

Please sign in to comment.