Apply for Zend Framework Certification Training

Zend Framework 2




namespace Application\Model;
use Zend\Db\TableGateway\TableGateway;
use Zend\Db\Sql\Where;
class HotelTable
{
	protected $tableGateway;
	public function __construct(TableGateway $tableGateway)
	{
		$this->tableGateway=$tableGateway;
	}
	
	public function fetchAll()
	{
		$sqlSelect = $this->tableGateway->getSql()->select();
		$sqlSelect->columns(array('*'));
		$sqlSelect->join('employee', 'employee.id = hotel.hotelId', array(), 'inner');
		$resultSet= $this->tableGateway->selectWith($sqlSelect);
		return $resultSet;
		
	}
}
                                    

< First Last >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top