/** * @param integer $id * @return mixed */ public function get($id = null) { if ($id !== null) { if ($this->crudManager instanceof CrudManagerInterface) { return $this->crudManager->get($id); } else { $query = $this->source->createQueryBuilder('entity'); return $query->andWhere('entity.id = :id')->setParameter('id', $id)->getQuery()->getOneOrNullResult(); } } return null; }
/** * @param int $id * @return mixed */ public function get(int $id = null) { if ($id !== null) { if ($this->crudManager instanceof CrudManagerInterface) { return $this->crudManager->get($id); } else { $this->source->clear(); return $this->source->findPk(1); } } return null; }