1
0
mirror of https://github.com/dg/dibi.git synced 2025-10-21 17:58:02 +02:00

- new DibiTable constructor

- moved "tricky clone" from DibiConnection::query to IDibiDriver::query
This commit is contained in:
David Grudl
2008-06-10 01:09:23 +00:00
parent 4e41f1641e
commit d12895102f
12 changed files with 26 additions and 31 deletions

View File

@@ -37,9 +37,6 @@ abstract class DibiTable extends /*Nette::*/Object
/** @var DibiConnection */
private $connection;
/** @var array */
private $options;
/** @var string table name */
protected $name;
@@ -53,20 +50,16 @@ abstract class DibiTable extends /*Nette::*/Object
protected $blankRow = array();
/**
* Table constructor.
* @param array
* @param DibiConnection
* @return void
*/
public function __construct(array $options = array())
public function __construct(DibiConnection $connection = NULL)
{
$this->options = $options;
$this->connection = $connection === NULL ? dibi::getConnection() : $connection;
$this->setup();
if ($this->connection === NULL) {
$this->connection = dibi::getConnection();
}
}