Source of file RowGateway.php
Size: 1,490 Bytes - Last Modified: 2014-03-12T23:21:18+01:00
/home/theseer/Downloads/ZendFramework-2.3.0/library/Zend/Db/RowGateway/RowGateway.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace Zend\Db\RowGateway; use Zend\Db\Adapter\Adapter; use Zend\Db\Sql\Sql; class RowGateway extends AbstractRowGateway { /** * Constructor * * @param string $primaryKeyColumn * @param string|\Zend\Db\Sql\TableIdentifier $table * @param Adapter|Sql $adapterOrSql * @throws Exception\InvalidArgumentException */ public function __construct($primaryKeyColumn, $table, $adapterOrSql = null) { // setup primary key $this->primaryKeyColumn = (array) $primaryKeyColumn; // set table $this->table = $table; // set Sql object if ($adapterOrSql instanceof Sql) { $this->sql = $adapterOrSql; } elseif ($adapterOrSql instanceof Adapter) { $this->sql = new Sql($adapterOrSql, $this->table); } else { throw new Exception\InvalidArgumentException('A valid Sql object was not provided.'); } if ($this->sql->getTable() !== $this->table) { throw new Exception\InvalidArgumentException('The Sql object provided does not have a table that matches this row object'); } $this->initialize(); } } |