mirror of
https://github.com/jbcr/core.git
synced 2026-04-03 06:42:30 +02:00
This is commit c3ead6d48cc2431d72ae7f81947df7fa5fefa92b in https://github.com/bolt/bolt Copied on 2018-10-30 14:00 Once Query works, it could be refactored from `Bolt\Storage\Query` to `Bolt\Query`
41 lines
847 B
PHP
41 lines
847 B
PHP
<?php
|
|
|
|
namespace Bolt\Storage\Query;
|
|
|
|
use Bolt\Storage\Collection\LazyCollection;
|
|
use Bolt\Storage\EntityManager;
|
|
use Bolt\Storage\EntityProxy;
|
|
|
|
/**
|
|
* This class builds on the default QueryResultset to add
|
|
* the ability to merge sets based on weighted scores.
|
|
*/
|
|
class TaxonomyQueryResultset extends QueryResultset
|
|
{
|
|
protected $em;
|
|
|
|
public function getCollection()
|
|
{
|
|
$collection = new LazyCollection();
|
|
|
|
foreach ($this->results as $proxy) {
|
|
$collection->add(new EntityProxy($proxy['contenttype'], $proxy['id'], $this->getEntityManager()));
|
|
}
|
|
|
|
return $collection;
|
|
}
|
|
|
|
public function setEntityManager(EntityManager $em)
|
|
{
|
|
$this->em = $em;
|
|
}
|
|
|
|
/**
|
|
* @return EntityManager
|
|
*/
|
|
public function getEntityManager()
|
|
{
|
|
return $this->em;
|
|
}
|
|
}
|