zf2 db sql

http://framework.zend.com/manual/2.2/en/modules/zend.db.sql.html
http://samsonasik.wordpress.com/2012/08/14/zend-framework-2-zenddbsql-join-tables/
cau hinh o duoi co binh luan:
‘initializers’ => array(
function ($instance, $sm) {
if ($instance instanceof \Zend\Db\TableGateway\AbstractTableGateway) {
$instance->setDbAdapter($sm->get(‘Zend\Db\Adapter\Adapter’));
}
}
),
http://samsonasik.wordpress.com/2012/08/28/set-default-db-adapter-in-zend-framework-2/?relatedposts_exclude=1526
http://samsonasik.wordpress.com/2012/06/06/zend-framework-2-handling-multiple-database/?relatedposts_exclude=1550
public function getJoin()
{
      $select = new \Zend\Db\Sql\Select ;
      $select->from(‘album’);
      $select->join(‘tracks’,’tracks.album_id = album.id’);
   
     $resultSet = $this->tableGateway->selectWith($select);
         
     return $resultSet;
}
http://samsonasik.wordpress.com/2013/09/05/zend-framework-2-using-hydratingresultset-and-objectproperty-s-hydrator/?relatedposts_exclude=1693

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s