symfony - How to get the id of all the materials? -
help me
public function indexaction() { $tpos = $this->getdoctrine()->getrepository('testbundle:materials')->findall(); foreach($tposs $tpos) { $posts['id']; } echo $midcount;
how you?
notice: undefined index: id
$materials = $this->getdoctrine()->getrepository('testbundle:materials')->findall(); $materialids = array(); foreach ($materials $material) { $materialids[] = $material->getid(); }
Comments
Post a Comment