1
我需要上傳的彈性,當我創建的實體鉛,只有誰已經地位認可,這是我的,映射:Symfony的ElasticaBundle聽衆和query_builder_method
persistence:
driver: orm
model: Artel\ProfileBundle\Entity\Lead
provider:
query_builder_method: createIsActiveQueryBuilder
listener: ~
finder: ~
和我query_builder_method:createIsActiveQueryBuilder:
public function createIsActiveQueryBuilder()
{
$qb = $this->getEntityManager()->createQueryBuilder('d');
$qb
->select('d')
->from('ArtelProfileBundle:Lead', 'd')
->where('d.statusLead = :status')
->setParameter('status', 'approved')
;
return $qb;
}
當我跑我已上傳領先地位只批准
app/console fos:elastica:populate --no-reset
創建鉛
$lead = new Lead();
//some logic
$manager->persist($lead);
$manager->flush();
但是,當我創建的默認狀態的新線索「not_approved」這個帶頭彈性上傳,爲什麼我不明白聽衆上傳這個領先優勢,爲什麼不工作query_builder?