Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Db / RowGateway / RowGateway.php
blob7c9fc775667260cfc2da4cef4052418d49ad293f
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Db\RowGateway;
12 use Zend\Db\Adapter\Adapter;
13 use Zend\Db\Sql\Sql;
15 class RowGateway extends AbstractRowGateway
18 /**
19 * Constructor
21 * @param string $primaryKeyColumn
22 * @param string|\Zend\Db\Sql\TableIdentifier $table
23 * @param Adapter|Sql $adapterOrSql
24 * @throws Exception\InvalidArgumentException
26 public function __construct($primaryKeyColumn, $table, $adapterOrSql = null)
28 // setup primary key
29 $this->primaryKeyColumn = (array) $primaryKeyColumn;
31 // set table
32 $this->table = $table;
34 // set Sql object
35 if ($adapterOrSql instanceof Sql) {
36 $this->sql = $adapterOrSql;
37 } elseif ($adapterOrSql instanceof Adapter) {
38 $this->sql = new Sql($adapterOrSql, $this->table);
39 } else {
40 throw new Exception\InvalidArgumentException('A valid Sql object was not provided.');
43 if ($this->sql->getTable() !== $this->table) {
44 throw new Exception\InvalidArgumentException('The Sql object provided does not have a table that matches this row object');
47 $this->initialize();