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

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -