php - zf2 : join with tablegateway dont work -
i tried make join statement tablegateway method wich 1 table 'a' retrieve field 'bfield' other table 'b', in way on 'atable' model:
public function geta($id){ $id = (int) $id; $resultset = $this->tablegateway->select( function(select $select) use ($id) { $select->join( 'b' , 'b.id = a.bfield_id' , array('bfield') ) ->where->equalto( 'a.id' , $id ); }); $row = $resultset->current(); return $row; }
the problema thar dont return 'bfield'. there other way work, return simple array, , need return 'a' object because wil bind on edit form.
whats missing here ?
i got. put 'bfield' field in model 'a' in 'exchangearray()' function list of vars , works.
Comments
Post a Comment