em = $em; $this->merchantResolver = $merchantResolver; $this->sectionResolver = $sectionResolver; } public function create($params = array()) { $entityClass = $this->em->getEntityName($this->getEntityClass()); $entity = new $entityClass; if ($entity instanceof FilterMerchantInterface && !isset($params['merchant'])) { $params['merchant'] = $this->merchantResolver->getCurrent(); } if ($entity instanceof FilterSectionInterface && !isset($params['section'])) { $params['section'] = $this->sectionResolver->getCurrent(); } return parent::create($params); } }