symfonyproject에 다음 스크립트가 있습니다.find() 대 createQuery
use Rowoco\AllgemeinBundle\Entity\Place;
.
.
public function getPlacelist($iduser)
{
$em = $this->getDoctrine()->getManager();
$request = Request::createFromGlobals();
$placeRepo = $em->getRepository("RowocoAllgemeinBundle:Place");
$placeEntity = $placeRepo->findBy(
array(),
array(),
$request->request->get("limitCount"),
$request->request->get("limitStart")
);
//return $placeEntity;
$q = $em
->createQuery("SELECT p.description
FROM RowocoAllgemeinBundle:Place p
");
return $q->getResult();
}
나는 특별한 저장소가 없습니다. 하지만 findby()를 사용할 때, 결과를 얻지 못한다. createQuery를 사용할 때 결과로 2 행을 얻었습니다.
코드에서 오류를 어디에서 찾을 수 있습니까?
코드에서 findBy()에 조건이 없습니다. 모든 결과를 가져오고 findBy() 대신 findAll()을 사용하려는 경우에 조건이 있습니다. –