컨트롤러에서 getName()에 액세스하려고하는데 작동하지 않습니다.symfony getName()이 컨트롤러 내부에서 작동하지 않습니다.
이 하지 않는 일 :
$supplier = $em->getRepository('WICSupplierBundle:Supplier')->findBy(array('account'=>$account_id, 'id'=>$id));
$supplierName = $supplier->getName();
This doesnt return the name from the db....
I get the error: "Error: Call to a member function getName() on a non-object..."
이 이 작동합니까 :
$supplier = $em->getRepository('WICSupplierBundle:Supplier')->find($id);
$supplierName = $supplier->getName();
This returns the name from the db....
왜?
은 - VAR 타입 오브젝트되지 배열 리턴? var_dump를 시도 하시겠습니까? – sinisake