1

I need to get only accepted applications in the list of offers

Applications Entity has "state" as proprety . if the application is accepted "state" get "true"

protected function configureListFields(ListMapper $listMapper)
{
    $listMapper
        ->add('id')
        ->add('job')
        ->add('mission')
        ->add('applications') ; //  I need to get only accepted applications


}

I tried to make two admin class for Applications and call only accepted ones . But it doesn't work

->add('applications' ,null, array('admin_code' => 'admin.acceptedApplications'))) ;

Accepted ApplicationAdmin has as createQuery function the following code :

/**
 * {@inheritDoc}
 */
public function createQuery($context = 'list')
{
    $query = $this->getModelManager()->createQuery($this->getClass(), 'entity');

    $query->select('e');
    $query->from($this->getClass(), 'e');
    $query->where('e.state  = :a');
    $query->setParameter('a', true);

    return $query;

}
Mouna Ben Hmida
  • 345
  • 1
  • 7
  • 17

0 Answers0