Mass search and replace for coding standards changes, doc block formatting, and code spacing.
This commit is contained in:
parent
4ce2a36968
commit
27b369a5f3
28
draft/DB.php
28
draft/DB.php
@ -66,18 +66,22 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
const ERR_MANAGER_PARSE = -33;
|
const ERR_MANAGER_PARSE = -33;
|
||||||
const ERR_LOADMODULE = -34;
|
const ERR_LOADMODULE = -34;
|
||||||
const ERR_INSUFFICIENT_DATA = -35;
|
const ERR_INSUFFICIENT_DATA = -35;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $instances all the instances of this class
|
* @var array $instances all the instances of this class
|
||||||
*/
|
*/
|
||||||
protected static $instances = array();
|
protected static $instances = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $isConnected whether or not a connection has been established
|
* @var array $isConnected whether or not a connection has been established
|
||||||
*/
|
*/
|
||||||
protected $isConnected = false;
|
protected $isConnected = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var PDO $dbh the database handler
|
* @var PDO $dbh the database handler
|
||||||
*/
|
*/
|
||||||
protected $dbh;
|
protected $dbh;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $options
|
* @var array $options
|
||||||
*/
|
*/
|
||||||
@ -85,11 +89,13 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
'username' => null,
|
'username' => null,
|
||||||
'password' => null,
|
'password' => null,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Db_EventListener_Interface|Doctrine_Overloadable $listener
|
* @var Doctrine_Db_EventListener_Interface|Doctrine_Overloadable $listener
|
||||||
* listener for listening events
|
* listener for listening events
|
||||||
*/
|
*/
|
||||||
protected $listener;
|
protected $listener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $querySequence
|
* @var integer $querySequence
|
||||||
*/
|
*/
|
||||||
@ -125,12 +131,14 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
public function nextQuerySequence() {
|
public function nextQuerySequence() {
|
||||||
return ++$this->querySequence;
|
return ++$this->querySequence;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getQuerySequence
|
* getQuerySequence
|
||||||
*/
|
*/
|
||||||
public function getQuerySequence() {
|
public function getQuerySequence() {
|
||||||
return $this->querySequence;
|
return $this->querySequence;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDBH
|
* getDBH
|
||||||
*/
|
*/
|
||||||
@ -143,6 +151,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $this->options[$name];
|
return $this->options[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addListener
|
* addListener
|
||||||
*
|
*
|
||||||
@ -157,6 +166,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getListener
|
* getListener
|
||||||
*
|
*
|
||||||
@ -165,6 +175,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
public function getListener() {
|
public function getListener() {
|
||||||
return $this->listener;
|
return $this->listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setListener
|
* setListener
|
||||||
*
|
*
|
||||||
@ -209,6 +220,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
public static function getConnection($dsn = null, $username = null, $password = null) {
|
public static function getConnection($dsn = null, $username = null, $password = null) {
|
||||||
return new self($dsn, $username, $password);
|
return new self($dsn, $username, $password);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* driverName
|
* driverName
|
||||||
* converts a driver name like (oracle) to appropriate PDO
|
* converts a driver name like (oracle) to appropriate PDO
|
||||||
@ -223,6 +235,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parseDSN
|
* parseDSN
|
||||||
*
|
*
|
||||||
@ -301,6 +314,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
public function errorCode() {
|
public function errorCode() {
|
||||||
return $this->dbh->errorCode();
|
return $this->dbh->errorCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* errorInfo
|
* errorInfo
|
||||||
* Fetch extended error information associated with the last operation on the database handle
|
* Fetch extended error information associated with the last operation on the database handle
|
||||||
@ -310,6 +324,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
public function errorInfo() {
|
public function errorInfo() {
|
||||||
return $this->dbh->errorInfo();
|
return $this->dbh->errorInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prepare
|
* prepare
|
||||||
*
|
*
|
||||||
@ -330,6 +345,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* query
|
* query
|
||||||
*
|
*
|
||||||
@ -355,6 +371,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* quote
|
* quote
|
||||||
* quotes a string for use in a query
|
* quotes a string for use in a query
|
||||||
@ -367,6 +384,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $this->dbh->quote($input);
|
return $this->dbh->quote($input);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exec
|
* exec
|
||||||
* executes an SQL statement and returns the number of affected rows
|
* executes an SQL statement and returns the number of affected rows
|
||||||
@ -389,6 +407,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchAll
|
* fetchAll
|
||||||
*
|
*
|
||||||
@ -418,6 +437,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
public function fetchBoth($statement, array $params = array()) {
|
public function fetchBoth($statement, array $params = array()) {
|
||||||
return $this->query($statement, $params)->fetchAll(PDO::FETCH_BOTH);
|
return $this->query($statement, $params)->fetchAll(PDO::FETCH_BOTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* lastInsertId
|
* lastInsertId
|
||||||
*
|
*
|
||||||
@ -428,6 +448,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $this->dbh->lastInsertId();
|
return $this->dbh->lastInsertId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* begins a transaction
|
* begins a transaction
|
||||||
*
|
*
|
||||||
@ -444,6 +465,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* commits a transaction
|
* commits a transaction
|
||||||
*
|
*
|
||||||
@ -460,6 +482,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rollBack
|
* rollBack
|
||||||
*
|
*
|
||||||
@ -476,6 +499,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
$this->listener->onRollback($event);
|
$this->listener->onRollback($event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAttribute
|
* getAttribute
|
||||||
* retrieves a database connection attribute
|
* retrieves a database connection attribute
|
||||||
@ -488,12 +512,14 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
return $this->dbh->getAttribute($attribute);
|
return $this->dbh->getAttribute($attribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an array of available PDO drivers
|
* returns an array of available PDO drivers
|
||||||
*/
|
*/
|
||||||
public static function getAvailableDrivers() {
|
public static function getAvailableDrivers() {
|
||||||
return PDO::getAvailableDrivers();
|
return PDO::getAvailableDrivers();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setAttribute
|
* setAttribute
|
||||||
* sets an attribute
|
* sets an attribute
|
||||||
@ -507,6 +533,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
|
|
||||||
$this->dbh->setAttribute($attribute, $value);
|
$this->dbh->setAttribute($attribute, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getIterator
|
* getIterator
|
||||||
*
|
*
|
||||||
@ -516,6 +543,7 @@ class Doctrine_Db2 implements Countable, IteratorAggregate, Doctrine_Adapter_Int
|
|||||||
if($this->listener instanceof Doctrine_Db_Profiler)
|
if($this->listener instanceof Doctrine_Db_Profiler)
|
||||||
return $this->listener;
|
return $this->listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count
|
* count
|
||||||
* returns the number of executed queries
|
* returns the number of executed queries
|
||||||
|
@ -9,7 +9,7 @@ function __autoload($classname) {
|
|||||||
if (class_exists($classname)) {
|
if (class_exists($classname)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (! $path) {
|
if ( ! $path) {
|
||||||
$path = dirname(__FILE__);
|
$path = dirname(__FILE__);
|
||||||
}
|
}
|
||||||
$classpath = str_replace('Doctrine_', '',$classname);
|
$classpath = str_replace('Doctrine_', '',$classname);
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node
|
* Doctrine_Node
|
||||||
*
|
*
|
||||||
@ -75,7 +76,7 @@ class Doctrine_Node implements IteratorAggregate
|
|||||||
{
|
{
|
||||||
$class = 'Doctrine_Node_' . $implName;
|
$class = 'Doctrine_Node_' . $implName;
|
||||||
|
|
||||||
if (!class_exists($class)) {
|
if ( ! class_exists($class)) {
|
||||||
throw new Doctrine_Node_Exception("The class $class must exist and extend Doctrine_Node");
|
throw new Doctrine_Node_Exception("The class $class must exist and extend Doctrine_Node");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_AdjacencyList
|
* Doctrine_Node_AdjacencyList
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_AdjacencyList_LevelOrderIterator
|
* Doctrine_Node_AdjacencyList_LevelOrderIterator
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_AdjacencyList_PostOrderIterator
|
* Doctrine_Node_AdjacencyList_PostOrderIterator
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_AdjacencyList_PreOrderIterator
|
* Doctrine_Node_AdjacencyList_PreOrderIterator
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_Exception
|
* Doctrine_Node_Exception
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_Interface
|
* Doctrine_Node_Interface
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_MaterializedPath
|
* Doctrine_Node_MaterializedPath
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_MaterializedPath_LevelOrderIterator
|
* Doctrine_Node_MaterializedPath_LevelOrderIterator
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_MaterializedPath_PostOrderIterator
|
* Doctrine_Node_MaterializedPath_PostOrderIterator
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_MaterializedPath_PreOrderIterator
|
* Doctrine_Node_MaterializedPath_PreOrderIterator
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_NestedSet
|
* Doctrine_Node_NestedSet
|
||||||
*
|
*
|
||||||
@ -461,7 +462,7 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accomplishes moving of nodes between different trees.
|
* Accomplishes moving of nodes between different trees.
|
||||||
* Used by the move* methods if the root value of the two nodes are different.
|
* Used by the move* methods if the root value of the two nodes are different.
|
||||||
@ -548,7 +549,7 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* moves node as prev sibling of dest record
|
* moves node as prev sibling of dest record
|
||||||
*
|
*
|
||||||
@ -616,7 +617,7 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
|
|||||||
$this->updateNode($dest->getNode()->getRightValue(), $this->record['level'] - $oldLevel);
|
$this->updateNode($dest->getNode()->getRightValue(), $this->record['level'] - $oldLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Makes this node a root node. Only used in multiple-root trees.
|
* Makes this node a root node. Only used in multiple-root trees.
|
||||||
*
|
*
|
||||||
@ -899,7 +900,7 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
|
|||||||
|
|
||||||
$resultRight = $qRight->execute();
|
$resultRight = $qRight->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gets record's left value
|
* gets record's left value
|
||||||
*
|
*
|
||||||
@ -947,7 +948,7 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
|
|||||||
*/
|
*/
|
||||||
public function getLevel()
|
public function getLevel()
|
||||||
{
|
{
|
||||||
if (!isset($this->level)) {
|
if ( ! isset($this->level)) {
|
||||||
$componentName = $this->record->getTable()->getComponentName();
|
$componentName = $this->record->getTable()->getComponentName();
|
||||||
$q = $this->_tree->getBaseQuery();
|
$q = $this->_tree->getBaseQuery();
|
||||||
$q = $q->where('base.lft < ? AND base.rgt > ?', array($this->getLeftValue(), $this->getRightValue()));
|
$q = $q->where('base.lft < ? AND base.rgt > ?', array($this->getLeftValue(), $this->getRightValue()));
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_NestedSet_LevelOrderIterator
|
* Doctrine_Node_NestedSet_LevelOrderIterator
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_NestedSet_PostOrderIterator
|
* Doctrine_Node_NestedSet_PostOrderIterator
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Node_NestedSet_PreOrderIterator
|
* Doctrine_Node_NestedSet_PreOrderIterator
|
||||||
*
|
*
|
||||||
@ -35,26 +36,32 @@ class Doctrine_Node_NestedSet_PreOrderIterator implements Iterator
|
|||||||
* @var Doctrine_Collection $collection
|
* @var Doctrine_Collection $collection
|
||||||
*/
|
*/
|
||||||
protected $collection;
|
protected $collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $keys
|
* @var array $keys
|
||||||
*/
|
*/
|
||||||
protected $keys;
|
protected $keys;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var mixed $key
|
* @var mixed $key
|
||||||
*/
|
*/
|
||||||
protected $key;
|
protected $key;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $index
|
* @var integer $index
|
||||||
*/
|
*/
|
||||||
protected $index;
|
protected $index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $index
|
* @var integer $index
|
||||||
*/
|
*/
|
||||||
protected $prevIndex;
|
protected $prevIndex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $index
|
* @var integer $index
|
||||||
*/
|
*/
|
||||||
protected $traverseLevel;
|
protected $traverseLevel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $count
|
* @var integer $count
|
||||||
*/
|
*/
|
||||||
@ -155,7 +162,7 @@ class Doctrine_Node_NestedSet_PreOrderIterator implements Iterator
|
|||||||
|
|
||||||
private function updateLevel()
|
private function updateLevel()
|
||||||
{
|
{
|
||||||
if (!(isset($this->options['include_record']) && $this->options['include_record'] && $this->index == 0)) {
|
if ( ! (isset($this->options['include_record']) && $this->options['include_record'] && $this->index == 0)) {
|
||||||
$left = $this->collection->get($this->key)->getNode()->getLeftValue();
|
$left = $this->collection->get($this->key)->getNode()->getLeftValue();
|
||||||
$this->level += $this->prevLeft - $left + 2;
|
$this->level += $this->prevLeft - $left + 2;
|
||||||
$this->prevLeft = $left;
|
$this->prevLeft = $left;
|
||||||
|
@ -169,6 +169,7 @@ class Doctrine_Query_Where extends Doctrine_Query_Condition
|
|||||||
}
|
}
|
||||||
return $where;
|
return $where;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parses an EXISTS expression
|
* parses an EXISTS expression
|
||||||
*
|
*
|
||||||
@ -189,6 +190,7 @@ class Doctrine_Query_Where extends Doctrine_Query_Condition
|
|||||||
|
|
||||||
return $operator . ' ('.$this->query->createSubquery()->parseQuery($sub, false)->getQuery() . ')';
|
return $operator . ' ('.$this->query->createSubquery()->parseQuery($sub, false)->getQuery() . ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getOperator
|
* getOperator
|
||||||
*
|
*
|
||||||
@ -210,6 +212,7 @@ class Doctrine_Query_Where extends Doctrine_Query_Condition
|
|||||||
}
|
}
|
||||||
return $operator;
|
return $operator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __toString
|
* __toString
|
||||||
* return string representation of this object
|
* return string representation of this object
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Table represents a database table
|
* Doctrine_Table represents a database table
|
||||||
* each Doctrine_Table holds the information of foreignKeys and associations
|
* each Doctrine_Table holds the information of foreignKeys and associations
|
||||||
@ -36,43 +37,53 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
* @var array $data temporary data which is then loaded into Doctrine_Record::$data
|
* @var array $data temporary data which is then loaded into Doctrine_Record::$data
|
||||||
*/
|
*/
|
||||||
private $data = array();
|
private $data = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $relations an array containing all the Doctrine_Relation objects for this table
|
* @var array $relations an array containing all the Doctrine_Relation objects for this table
|
||||||
*/
|
*/
|
||||||
private $relations = array();
|
private $relations = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $primaryKeys an array containing all primary key column names
|
* @var array $primaryKeys an array containing all primary key column names
|
||||||
*/
|
*/
|
||||||
private $primaryKeys = array();
|
private $primaryKeys = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var mixed $identifier
|
* @var mixed $identifier
|
||||||
*/
|
*/
|
||||||
private $identifier;
|
private $identifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Doctrine_Identifier constants
|
* @see Doctrine_Identifier constants
|
||||||
* @var integer $identifierType the type of identifier this table uses
|
* @var integer $identifierType the type of identifier this table uses
|
||||||
*/
|
*/
|
||||||
private $identifierType;
|
private $identifierType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $query cached simple query
|
* @var string $query cached simple query
|
||||||
*/
|
*/
|
||||||
private $query;
|
private $query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Connection $conn Doctrine_Connection object that created this table
|
* @var Doctrine_Connection $conn Doctrine_Connection object that created this table
|
||||||
*/
|
*/
|
||||||
private $conn;
|
private $conn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $name
|
* @var string $name
|
||||||
*/
|
*/
|
||||||
private $name;
|
private $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $identityMap first level cache
|
* @var array $identityMap first level cache
|
||||||
*/
|
*/
|
||||||
private $identityMap = array();
|
private $identityMap = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Table_Repository $repository record repository
|
* @var Doctrine_Table_Repository $repository record repository
|
||||||
*/
|
*/
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $columns an array of column definitions,
|
* @var array $columns an array of column definitions,
|
||||||
* keys as column names and values as column definitions
|
* keys as column names and values as column definitions
|
||||||
@ -90,27 +101,33 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
protected $columns = array();
|
protected $columns = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $bound bound relations
|
* @var array $bound bound relations
|
||||||
*/
|
*/
|
||||||
private $bound = array();
|
private $bound = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $boundAliases bound relation aliases
|
* @var array $boundAliases bound relation aliases
|
||||||
*/
|
*/
|
||||||
private $boundAliases = array();
|
private $boundAliases = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $columnCount cached column count, Doctrine_Record uses this column count in when
|
* @var integer $columnCount cached column count, Doctrine_Record uses this column count in when
|
||||||
* determining its state
|
* determining its state
|
||||||
*/
|
*/
|
||||||
private $columnCount;
|
private $columnCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $parents the parent classes of this component
|
* @var array $parents the parent classes of this component
|
||||||
*/
|
*/
|
||||||
private $parents = array();
|
private $parents = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $hasDefaultValues whether or not this table has default values
|
* @var boolean $hasDefaultValues whether or not this table has default values
|
||||||
*/
|
*/
|
||||||
private $hasDefaultValues;
|
private $hasDefaultValues;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $options an array containing all options
|
* @var array $options an array containing all options
|
||||||
*
|
*
|
||||||
@ -288,6 +305,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
$this->repository = new Doctrine_Table_Repository($this);
|
$this->repository = new Doctrine_Table_Repository($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createQuery
|
* createQuery
|
||||||
* creates a new Doctrine_Query object and adds the component name
|
* creates a new Doctrine_Query object and adds the component name
|
||||||
@ -298,6 +316,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function createQuery() {
|
public function createQuery() {
|
||||||
return Doctrine_Query::create()->from($this->getComponentName());
|
return Doctrine_Query::create()->from($this->getComponentName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getRepository
|
* getRepository
|
||||||
*
|
*
|
||||||
@ -330,6 +349,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setColumn
|
* setColumn
|
||||||
* @param string $name
|
* @param string $name
|
||||||
@ -360,6 +380,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
$this->hasDefaultValues = true;
|
$this->hasDefaultValues = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasDefaultValues
|
* hasDefaultValues
|
||||||
* returns true if this table has default values, otherwise false
|
* returns true if this table has default values, otherwise false
|
||||||
@ -369,6 +390,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function hasDefaultValues() {
|
public function hasDefaultValues() {
|
||||||
return $this->hasDefaultValues;
|
return $this->hasDefaultValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDefaultValueOf
|
* getDefaultValueOf
|
||||||
* returns the default value(if any) for given column
|
* returns the default value(if any) for given column
|
||||||
@ -387,18 +409,21 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
} else
|
} else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
final public function getIdentifier() {
|
final public function getIdentifier() {
|
||||||
return $this->identifier;
|
return $this->identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
final public function getIdentifierType() {
|
final public function getIdentifierType() {
|
||||||
return $this->identifierType;
|
return $this->identifierType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasColumn
|
* hasColumn
|
||||||
* @return boolean
|
* @return boolean
|
||||||
@ -406,6 +431,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
final public function hasColumn($name) {
|
final public function hasColumn($name) {
|
||||||
return isset($this->columns[$name]);
|
return isset($this->columns[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $key
|
* @param mixed $key
|
||||||
* @return void
|
* @return void
|
||||||
@ -420,6 +446,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
break;
|
break;
|
||||||
endswitch;
|
endswitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns all primary keys
|
* returns all primary keys
|
||||||
* @return array
|
* @return array
|
||||||
@ -427,12 +454,14 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
final public function getPrimaryKeys() {
|
final public function getPrimaryKeys() {
|
||||||
return $this->primaryKeys;
|
return $this->primaryKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
final public function hasPrimaryKey($key) {
|
final public function hasPrimaryKey($key) {
|
||||||
return in_array($key,$this->primaryKeys);
|
return in_array($key,$this->primaryKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $sequence
|
* @param $sequence
|
||||||
* @return void
|
* @return void
|
||||||
@ -440,30 +469,35 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
final public function setSequenceName($sequence) {
|
final public function setSequenceName($sequence) {
|
||||||
$this->options['sequenceName'] = $sequence;
|
$this->options['sequenceName'] = $sequence;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string sequence name
|
* @return string sequence name
|
||||||
*/
|
*/
|
||||||
final public function getSequenceName() {
|
final public function getSequenceName() {
|
||||||
return $this->options['sequenceName'];
|
return $this->options['sequenceName'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getParents
|
* getParents
|
||||||
*/
|
*/
|
||||||
final public function getParents() {
|
final public function getParents() {
|
||||||
return $this->parents;
|
return $this->parents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
final public function hasInheritanceMap() {
|
final public function hasInheritanceMap() {
|
||||||
return (empty($this->options['inheritanceMap']));
|
return (empty($this->options['inheritanceMap']));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array inheritance map (array keys as fields)
|
* @return array inheritance map (array keys as fields)
|
||||||
*/
|
*/
|
||||||
final public function getInheritanceMap() {
|
final public function getInheritanceMap() {
|
||||||
return $this->options['inheritanceMap'];
|
return $this->options['inheritanceMap'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return all composite paths in the form [component1].[component2]. . .[componentN]
|
* return all composite paths in the form [component1].[component2]. . .[componentN]
|
||||||
* @return array
|
* @return array
|
||||||
@ -493,6 +527,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
}
|
}
|
||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns all bound relations
|
* returns all bound relations
|
||||||
*
|
*
|
||||||
@ -501,6 +536,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function getBounds() {
|
public function getBounds() {
|
||||||
return $this->bound;
|
return $this->bound;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a bound relation array
|
* returns a bound relation array
|
||||||
*
|
*
|
||||||
@ -513,6 +549,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return $this->bound[$name];
|
return $this->bound[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a bound relation array
|
* returns a bound relation array
|
||||||
*
|
*
|
||||||
@ -530,6 +567,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
}
|
}
|
||||||
throw new Doctrine_Table_Exception('Unknown bound '.$name);
|
throw new Doctrine_Table_Exception('Unknown bound '.$name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the alias for given component name
|
* returns the alias for given component name
|
||||||
*
|
*
|
||||||
@ -542,6 +580,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns component name for given alias
|
* returns component name for given alias
|
||||||
*
|
*
|
||||||
@ -554,6 +593,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return $alias;
|
return $alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unbinds all relations
|
* unbinds all relations
|
||||||
*
|
*
|
||||||
@ -564,6 +604,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
$this->relations = array();
|
$this->relations = array();
|
||||||
$this->boundAliases = array();
|
$this->boundAliases = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unbinds a relation
|
* unbinds a relation
|
||||||
* returns true on success, false on failure
|
* returns true on success, false on failure
|
||||||
@ -585,6 +626,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* binds a relation
|
* binds a relation
|
||||||
*
|
*
|
||||||
@ -608,6 +650,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
$this->bound[$alias] = array($field, $type, $localKey, $name);
|
$this->bound[$alias] = array($field, $type, $localKey, $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getComponentName
|
* getComponentName
|
||||||
* @return string the component name
|
* @return string the component name
|
||||||
@ -615,12 +658,14 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function getComponentName() {
|
public function getComponentName() {
|
||||||
return $this->options['name'];
|
return $this->options['name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Doctrine_Connection
|
* @return Doctrine_Connection
|
||||||
*/
|
*/
|
||||||
public function getConnection() {
|
public function getConnection() {
|
||||||
return $this->conn;
|
return $this->conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasRelatedComponent
|
* hasRelatedComponent
|
||||||
* @return boolean
|
* @return boolean
|
||||||
@ -628,6 +673,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
final public function hasRelatedComponent($name, $component) {
|
final public function hasRelatedComponent($name, $component) {
|
||||||
return (strpos($this->bound[$name][0], $component.'.') !== false);
|
return (strpos($this->bound[$name][0], $component.'.') !== false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name component name of which a foreign key object is bound
|
* @param string $name component name of which a foreign key object is bound
|
||||||
* @return boolean
|
* @return boolean
|
||||||
@ -643,6 +689,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getRelation
|
* getRelation
|
||||||
*
|
*
|
||||||
@ -749,6 +796,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
throw new Doctrine_Table_Exception($this->options['name'] . " doesn't have a relation to " . $original);
|
throw new Doctrine_Table_Exception($this->options['name'] . " doesn't have a relation to " . $original);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an array containing all foreign key objects
|
* returns an array containing all foreign key objects
|
||||||
*
|
*
|
||||||
@ -762,6 +810,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return $this->relations;
|
return $this->relations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sets the database table name
|
* sets the database table name
|
||||||
*
|
*
|
||||||
@ -780,6 +829,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
final public function getTableName() {
|
final public function getTableName() {
|
||||||
return $this->options['tableName'];
|
return $this->options['tableName'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create
|
* create
|
||||||
* creates a new record
|
* creates a new record
|
||||||
@ -793,6 +843,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
$this->data = array();
|
$this->data = array();
|
||||||
return $record;
|
return $record;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* finds a record by its identifier
|
* finds a record by its identifier
|
||||||
*
|
*
|
||||||
@ -823,6 +874,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* applyInheritance
|
* applyInheritance
|
||||||
* @param $where query where part to be modified
|
* @param $where query where part to be modified
|
||||||
@ -839,6 +891,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
}
|
}
|
||||||
return $where;
|
return $where;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* findAll
|
* findAll
|
||||||
* returns a collection of records
|
* returns a collection of records
|
||||||
@ -850,6 +903,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
$users = $graph->query("FROM ".$this->options['name']);
|
$users = $graph->query("FROM ".$this->options['name']);
|
||||||
return $users;
|
return $users;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* findByDql
|
* findByDql
|
||||||
* finds records with given DQL where clause
|
* finds records with given DQL where clause
|
||||||
@ -868,6 +922,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function findByDql($dql, array $params = array()) {
|
public function findByDql($dql, array $params = array()) {
|
||||||
return $this->findBySql($dql, $params);
|
return $this->findBySql($dql, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clear
|
* clear
|
||||||
* clears the first level cache (identityMap)
|
* clears the first level cache (identityMap)
|
||||||
@ -877,6 +932,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function clear() {
|
public function clear() {
|
||||||
$this->identityMap = array();
|
$this->identityMap = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getRecord
|
* getRecord
|
||||||
* first checks if record exists in identityMap, if not
|
* first checks if record exists in identityMap, if not
|
||||||
@ -911,6 +967,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return $record;
|
return $record;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $id database row id
|
* @param $id database row id
|
||||||
* @throws Doctrine_Find_Exception
|
* @throws Doctrine_Find_Exception
|
||||||
@ -929,6 +986,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
}
|
}
|
||||||
return $this->getRecord();
|
return $this->getRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count
|
* count
|
||||||
*
|
*
|
||||||
@ -938,6 +996,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
$a = $this->conn->getDBH()->query("SELECT COUNT(1) FROM ".$this->options['tableName'])->fetch(PDO::FETCH_NUM);
|
$a = $this->conn->getDBH()->query("SELECT COUNT(1) FROM ".$this->options['tableName'])->fetch(PDO::FETCH_NUM);
|
||||||
return current($a);
|
return current($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Doctrine_Query a Doctrine_Query object
|
* @return Doctrine_Query a Doctrine_Query object
|
||||||
*/
|
*/
|
||||||
@ -946,6 +1005,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
$graph->load($this->getComponentName());
|
$graph->load($this->getComponentName());
|
||||||
return $graph;
|
return $graph;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute
|
* execute
|
||||||
* @param string $query
|
* @param string $query
|
||||||
@ -972,6 +1032,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
}
|
}
|
||||||
return $coll;
|
return $coll;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sets enumerated value array for given field
|
* sets enumerated value array for given field
|
||||||
*
|
*
|
||||||
@ -982,6 +1043,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
final public function setEnumValues($field, array $values) {
|
final public function setEnumValues($field, array $values) {
|
||||||
$this->options['enumMap'][strtolower($field)] = $values;
|
$this->options['enumMap'][strtolower($field)] = $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $field
|
* @param string $field
|
||||||
* @return array
|
* @return array
|
||||||
@ -992,6 +1054,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
else
|
else
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enumValue
|
* enumValue
|
||||||
*
|
*
|
||||||
@ -1005,6 +1068,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return isset($this->options['enumMap'][$field][$index]) ? $this->options['enumMap'][$field][$index] : $index;
|
return isset($this->options['enumMap'][$field][$index]) ? $this->options['enumMap'][$field][$index] : $index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* invokeSet
|
* invokeSet
|
||||||
*
|
*
|
||||||
@ -1015,7 +1079,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
return $value;
|
return $value;
|
||||||
|
|
||||||
$prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_SET);
|
$prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_SET);
|
||||||
if (!$prefix)
|
if ( ! $prefix)
|
||||||
$prefix = 'set';
|
$prefix = 'set';
|
||||||
|
|
||||||
$method = $prefix . $name;
|
$method = $prefix . $name;
|
||||||
@ -1026,6 +1090,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* invokeGet
|
* invokeGet
|
||||||
*
|
*
|
||||||
@ -1036,7 +1101,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
return $value;
|
return $value;
|
||||||
|
|
||||||
$prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_GET);
|
$prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_GET);
|
||||||
if (!$prefix)
|
if ( ! $prefix)
|
||||||
$prefix = 'get';
|
$prefix = 'get';
|
||||||
|
|
||||||
$method = $prefix . $name;
|
$method = $prefix . $name;
|
||||||
@ -1047,6 +1112,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enumIndex
|
* enumIndex
|
||||||
*
|
*
|
||||||
@ -1062,6 +1128,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return array_search($value, $values);
|
return array_search($value, $values);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDefinitionOf
|
* getDefinitionOf
|
||||||
*
|
*
|
||||||
@ -1073,6 +1140,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getColumnCount
|
* getColumnCount
|
||||||
*
|
*
|
||||||
@ -1090,6 +1158,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
final public function getColumns() {
|
final public function getColumns() {
|
||||||
return $this->columns;
|
return $this->columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an array containing all the column names
|
* returns an array containing all the column names
|
||||||
*
|
*
|
||||||
@ -1098,6 +1167,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function getColumnNames() {
|
public function getColumnNames() {
|
||||||
return array_keys($this->columns);
|
return array_keys($this->columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDefinitionOf
|
* getDefinitionOf
|
||||||
*
|
*
|
||||||
@ -1109,6 +1179,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTypeOf
|
* getTypeOf
|
||||||
*
|
*
|
||||||
@ -1120,6 +1191,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setData
|
* setData
|
||||||
* doctrine uses this function internally
|
* doctrine uses this function internally
|
||||||
@ -1131,6 +1203,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function setData(array $data) {
|
public function setData(array $data) {
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the maximum primary key value
|
* returns the maximum primary key value
|
||||||
*
|
*
|
||||||
@ -1142,6 +1215,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
$data = $stmt->fetch(PDO::FETCH_NUM);
|
$data = $stmt->fetch(PDO::FETCH_NUM);
|
||||||
return isset($data[0])?$data[0]:1;
|
return isset($data[0])?$data[0]:1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns simple cached query
|
* returns simple cached query
|
||||||
*
|
*
|
||||||
@ -1150,6 +1224,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
final public function getQuery() {
|
final public function getQuery() {
|
||||||
return $this->query;
|
return $this->query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns internal data, used by Doctrine_Record instances
|
* returns internal data, used by Doctrine_Record instances
|
||||||
* when retrieving data from database
|
* when retrieving data from database
|
||||||
@ -1159,6 +1234,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
final public function getData() {
|
final public function getData() {
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a string representation of this object
|
* returns a string representation of this object
|
||||||
*
|
*
|
||||||
@ -1167,6 +1243,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function __toString() {
|
public function __toString() {
|
||||||
return Doctrine_Lib::getTableAsString($this);
|
return Doctrine_Lib::getTableAsString($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a string representation of this object
|
* returns a string representation of this object
|
||||||
*
|
*
|
||||||
@ -1181,6 +1258,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
// set the table definition for the given tree implementation
|
// set the table definition for the given tree implementation
|
||||||
$this->_tree->setTableDefinition();
|
$this->_tree->setTableDefinition();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getter for associated tree
|
* getter for associated tree
|
||||||
*
|
*
|
||||||
@ -1189,6 +1267,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function getTree() {
|
public function getTree() {
|
||||||
return isset($this->_treeImplName) ? $this->_tree : false;
|
return isset($this->_treeImplName) ? $this->_tree : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* determine if table acts as tree
|
* determine if table acts as tree
|
||||||
*
|
*
|
||||||
@ -1197,6 +1276,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function isTree() {
|
public function isTree() {
|
||||||
return !is_null($this->_treeImplName) ? true : false;
|
return !is_null($this->_treeImplName) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getter for tree implementation name
|
* getter for tree implementation name
|
||||||
*
|
*
|
||||||
@ -1205,6 +1285,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable {
|
|||||||
public function getTreeImplName() {
|
public function getTreeImplName() {
|
||||||
return $this->_treeImplName;
|
return $this->_treeImplName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getter for tree options
|
* getter for tree options
|
||||||
*
|
*
|
||||||
|
@ -83,7 +83,7 @@ class Doctrine_Tree
|
|||||||
public static function factory(Doctrine_Table $table, $implName, $options = array())
|
public static function factory(Doctrine_Table $table, $implName, $options = array())
|
||||||
{
|
{
|
||||||
$class = 'Doctrine_Tree_' . $implName;
|
$class = 'Doctrine_Tree_' . $implName;
|
||||||
if (!class_exists($class)) {
|
if ( ! class_exists($class)) {
|
||||||
throw new Doctrine_Exception('The chosen class must extend Doctrine_Tree');
|
throw new Doctrine_Exception('The chosen class must extend Doctrine_Tree');
|
||||||
}
|
}
|
||||||
return new $class($table, $options);
|
return new $class($table, $options);
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Tree_AdjacencyList
|
* Doctrine_Tree_AdjacencyList
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Tree_Exception
|
* Doctrine_Tree_Exception
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Tree_Interface
|
* Doctrine_Tree_Interface
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Tree_MaterializedPath
|
* Doctrine_Tree_MaterializedPath
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Tree_NestedSet
|
* Doctrine_Tree_NestedSet
|
||||||
*
|
*
|
||||||
@ -32,7 +33,7 @@
|
|||||||
class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Interface
|
class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Interface
|
||||||
{
|
{
|
||||||
private $_baseQuery;
|
private $_baseQuery;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor, creates tree with reference to table and sets default root options
|
* constructor, creates tree with reference to table and sets default root options
|
||||||
*
|
*
|
||||||
@ -48,7 +49,7 @@ class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Int
|
|||||||
|
|
||||||
parent::__construct($table, $options);
|
parent::__construct($table, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* used to define table attributes required for the NestetSet implementation
|
* used to define table attributes required for the NestetSet implementation
|
||||||
* adds lft and rgt columns for corresponding left and right values
|
* adds lft and rgt columns for corresponding left and right values
|
||||||
@ -99,7 +100,7 @@ class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Int
|
|||||||
{
|
{
|
||||||
return $this->fetchRoot($rootId);
|
return $this->fetchRoot($rootId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches a/the root node.
|
* Fetches a/the root node.
|
||||||
*
|
*
|
||||||
@ -254,7 +255,7 @@ class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Int
|
|||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter description here...
|
* Enter description here...
|
||||||
*
|
*
|
||||||
@ -263,12 +264,12 @@ class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Int
|
|||||||
*/
|
*/
|
||||||
public function getBaseQuery()
|
public function getBaseQuery()
|
||||||
{
|
{
|
||||||
if (!isset($this->_baseQuery)) {
|
if ( ! isset($this->_baseQuery)) {
|
||||||
$this->_baseQuery = $this->_createBaseQuery();
|
$this->_baseQuery = $this->_createBaseQuery();
|
||||||
}
|
}
|
||||||
return clone $this->_baseQuery;
|
return clone $this->_baseQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter description here...
|
* Enter description here...
|
||||||
*
|
*
|
||||||
@ -279,7 +280,7 @@ class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Int
|
|||||||
$q->select("base.*")->from($this->table->getComponentName() . " base");
|
$q->select("base.*")->from($this->table->getComponentName() . " base");
|
||||||
return $q;
|
return $q;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter description here...
|
* Enter description here...
|
||||||
*
|
*
|
||||||
@ -293,7 +294,7 @@ class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Int
|
|||||||
}
|
}
|
||||||
$this->_baseQuery = $query;
|
$this->_baseQuery = $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter description here...
|
* Enter description here...
|
||||||
*
|
*
|
||||||
@ -302,7 +303,7 @@ class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Int
|
|||||||
{
|
{
|
||||||
$this->_baseQuery = null;
|
$this->_baseQuery = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter description here...
|
* Enter description here...
|
||||||
*
|
*
|
||||||
|
@ -37,25 +37,30 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
* @var $dbh the database handler
|
* @var $dbh the database handler
|
||||||
*/
|
*/
|
||||||
protected $dbh;
|
protected $dbh;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $tables an array containing all the initialized Doctrine_Table objects
|
* @var array $tables an array containing all the initialized Doctrine_Table objects
|
||||||
* keys representing Doctrine_Table component names and values as Doctrine_Table objects
|
* keys representing Doctrine_Table component names and values as Doctrine_Table objects
|
||||||
*/
|
*/
|
||||||
protected $tables = array();
|
protected $tables = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $exported
|
* @var array $exported
|
||||||
*/
|
*/
|
||||||
protected $exported = array();
|
protected $exported = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $driverName the name of this connection driver
|
* @var string $driverName the name of this connection driver
|
||||||
*/
|
*/
|
||||||
protected $driverName;
|
protected $driverName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $supported an array containing all features this driver supports,
|
* @var array $supported an array containing all features this driver supports,
|
||||||
* keys representing feature names and values as
|
* keys representing feature names and values as
|
||||||
* one of the following (true, false, 'emulated')
|
* one of the following (true, false, 'emulated')
|
||||||
*/
|
*/
|
||||||
protected $supported = array();
|
protected $supported = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $modules an array containing all modules
|
* @var array $modules an array containing all modules
|
||||||
* transaction Doctrine_Transaction driver, handles savepoint and transaction isolation abstraction
|
* transaction Doctrine_Transaction driver, handles savepoint and transaction isolation abstraction
|
||||||
@ -85,6 +90,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
'sequence' => false,
|
'sequence' => false,
|
||||||
'unitOfWork' => false,
|
'unitOfWork' => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $properties an array of connection properties
|
* @var array $properties an array of connection properties
|
||||||
*/
|
*/
|
||||||
@ -103,10 +109,12 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
'wildcards' => array('%', '_'),
|
'wildcards' => array('%', '_'),
|
||||||
'varchar_max_length' => 255,
|
'varchar_max_length' => 255,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $serverInfo
|
* @var array $serverInfo
|
||||||
*/
|
*/
|
||||||
protected $serverInfo = array();
|
protected $serverInfo = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $availableDrivers an array containing all availible drivers
|
* @var array $availableDrivers an array containing all availible drivers
|
||||||
*/
|
*/
|
||||||
@ -143,6 +151,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$this->getAttribute(Doctrine::ATTR_LISTENER)->onOpen($this);
|
$this->getAttribute(Doctrine::ATTR_LISTENER)->onOpen($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getName
|
* getName
|
||||||
* returns the name of this driver
|
* returns the name of this driver
|
||||||
@ -153,6 +162,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->driverName;
|
return $this->driverName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __get
|
* __get
|
||||||
* lazy loads given module and returns it
|
* lazy loads given module and returns it
|
||||||
@ -187,6 +197,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $this->modules[$name];
|
return $this->modules[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Quotes pattern (% and _) characters in a string)
|
* Quotes pattern (% and _) characters in a string)
|
||||||
*
|
*
|
||||||
@ -209,6 +220,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
}
|
}
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convertBoolean
|
* convertBoolean
|
||||||
* some drivers need the boolean values to be converted into integers
|
* some drivers need the boolean values to be converted into integers
|
||||||
@ -232,6 +244,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
}
|
}
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Quote a string so it can be safely used as a table or column name
|
* Quote a string so it can be safely used as a table or column name
|
||||||
*
|
*
|
||||||
@ -276,6 +289,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
return $this->properties['identifier_quoting']['start']
|
return $this->properties['identifier_quoting']['start']
|
||||||
. $str . $this->properties['identifier_quoting']['end'];
|
. $str . $this->properties['identifier_quoting']['end'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the manager that created this connection
|
* returns the manager that created this connection
|
||||||
*
|
*
|
||||||
@ -285,6 +299,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->getParent();
|
return $this->getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the database handler of which this connection uses
|
* returns the database handler of which this connection uses
|
||||||
*
|
*
|
||||||
@ -294,6 +309,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->dbh;
|
return $this->dbh;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* converts given driver name
|
* converts given driver name
|
||||||
*
|
*
|
||||||
@ -302,6 +318,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
public function driverName($name)
|
public function driverName($name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* supports
|
* supports
|
||||||
*
|
*
|
||||||
@ -316,6 +333,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* quote
|
* quote
|
||||||
* quotes given input parameter
|
* quotes given input parameter
|
||||||
@ -351,6 +369,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
return $this->dbh->quote($input);
|
return $this->dbh->quote($input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes any formatting in an sequence name using the 'seqname_format' option
|
* Removes any formatting in an sequence name using the 'seqname_format' option
|
||||||
*
|
*
|
||||||
@ -367,6 +386,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
}
|
}
|
||||||
return $sqn;
|
return $sqn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes any formatting in an index name using the 'idxname_format' option
|
* Removes any formatting in an index name using the 'idxname_format' option
|
||||||
*
|
*
|
||||||
@ -382,6 +402,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
}
|
}
|
||||||
return $idx;
|
return $idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* adds sequence name formatting to a sequence name
|
* adds sequence name formatting to a sequence name
|
||||||
*
|
*
|
||||||
@ -393,6 +414,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
return sprintf($this->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT),
|
return sprintf($this->getAttribute(Doctrine::ATTR_SEQNAME_FORMAT),
|
||||||
preg_replace('/[^a-z0-9_\$.]/i', '_', $sqn));
|
preg_replace('/[^a-z0-9_\$.]/i', '_', $sqn));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* adds index name formatting to a index name
|
* adds index name formatting to a index name
|
||||||
*
|
*
|
||||||
@ -471,6 +493,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $affectedRows;
|
return $affectedRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inserts a table row with specified data.
|
* Inserts a table row with specified data.
|
||||||
*
|
*
|
||||||
@ -495,6 +518,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the charset on the current connection
|
* Set the charset on the current connection
|
||||||
*
|
*
|
||||||
@ -506,6 +530,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the date/time format for the current connection
|
* Set the date/time format for the current connection
|
||||||
*
|
*
|
||||||
@ -516,6 +541,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
public function setDateFormat($format = null)
|
public function setDateFormat($format = null)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchAll
|
* fetchAll
|
||||||
*
|
*
|
||||||
@ -527,6 +553,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetchAll(PDO::FETCH_ASSOC);
|
return $this->execute($statement, $params)->fetchAll(PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchOne
|
* fetchOne
|
||||||
*
|
*
|
||||||
@ -539,6 +566,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetchColumn($colnum);
|
return $this->execute($statement, $params)->fetchColumn($colnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchRow
|
* fetchRow
|
||||||
*
|
*
|
||||||
@ -550,6 +578,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetch(PDO::FETCH_ASSOC);
|
return $this->execute($statement, $params)->fetch(PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchArray
|
* fetchArray
|
||||||
*
|
*
|
||||||
@ -561,6 +590,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetch(PDO::FETCH_NUM);
|
return $this->execute($statement, $params)->fetch(PDO::FETCH_NUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchColumn
|
* fetchColumn
|
||||||
*
|
*
|
||||||
@ -573,6 +603,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetchAll(PDO::FETCH_COLUMN, $colnum);
|
return $this->execute($statement, $params)->fetchAll(PDO::FETCH_COLUMN, $colnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchAssoc
|
* fetchAssoc
|
||||||
*
|
*
|
||||||
@ -584,6 +615,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetchAll(PDO::FETCH_ASSOC);
|
return $this->execute($statement, $params)->fetchAll(PDO::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchBoth
|
* fetchBoth
|
||||||
*
|
*
|
||||||
@ -595,6 +627,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetchAll(PDO::FETCH_BOTH);
|
return $this->execute($statement, $params)->fetchAll(PDO::FETCH_BOTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* query
|
* query
|
||||||
* queries the database using Doctrine Query Language
|
* queries the database using Doctrine Query Language
|
||||||
@ -617,6 +650,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $parser->query($query, $params);
|
return $parser->query($query, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* query
|
* query
|
||||||
* queries the database using Doctrine Query Language and returns
|
* queries the database using Doctrine Query Language and returns
|
||||||
@ -646,6 +680,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
}
|
}
|
||||||
return $coll[0];
|
return $coll[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queries the database with limit and offset
|
* queries the database with limit and offset
|
||||||
* added to the query and returns a PDOStatement object
|
* added to the query and returns a PDOStatement object
|
||||||
@ -662,6 +697,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
}
|
}
|
||||||
return $this->dbh->query($query);
|
return $this->dbh->query($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* standaloneQuery
|
* standaloneQuery
|
||||||
*
|
*
|
||||||
@ -674,6 +710,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($query, $params);
|
return $this->execute($query, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute
|
* execute
|
||||||
* @param string $query sql query
|
* @param string $query sql query
|
||||||
@ -696,6 +733,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$this->rethrowException($e);
|
$this->rethrowException($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exec
|
* exec
|
||||||
* @param string $query sql query
|
* @param string $query sql query
|
||||||
@ -717,6 +755,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$this->rethrowException($e);
|
$this->rethrowException($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rethrowException
|
* rethrowException
|
||||||
*
|
*
|
||||||
@ -734,6 +773,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
throw $exc;
|
throw $exc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasTable
|
* hasTable
|
||||||
* whether or not this connection has table $name initialized
|
* whether or not this connection has table $name initialized
|
||||||
@ -745,6 +785,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return isset($this->tables[$name]);
|
return isset($this->tables[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a table object for given component name
|
* returns a table object for given component name
|
||||||
*
|
*
|
||||||
@ -816,6 +857,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $table;
|
return $table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an array of all initialized tables
|
* returns an array of all initialized tables
|
||||||
*
|
*
|
||||||
@ -825,6 +867,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->tables;
|
return $this->tables;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an iterator that iterators through all
|
* returns an iterator that iterators through all
|
||||||
* initialized table objects
|
* initialized table objects
|
||||||
@ -841,6 +884,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return new ArrayIterator($this->tables);
|
return new ArrayIterator($this->tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the count of initialized table objects
|
* returns the count of initialized table objects
|
||||||
*
|
*
|
||||||
@ -850,6 +894,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return count($this->tables);
|
return count($this->tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addTable
|
* addTable
|
||||||
* adds a Doctrine_Table object into connection registry
|
* adds a Doctrine_Table object into connection registry
|
||||||
@ -867,6 +912,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
$this->tables[$name] = $objTable;
|
$this->tables[$name] = $objTable;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create
|
* create
|
||||||
* creates a record
|
* creates a record
|
||||||
@ -879,6 +925,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->getTable($name)->create();
|
return $this->getTable($name)->create();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* flush
|
* flush
|
||||||
* saves all the records from all tables
|
* saves all the records from all tables
|
||||||
@ -893,6 +940,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
$this->unitOfWork->saveAll();
|
$this->unitOfWork->saveAll();
|
||||||
$this->commit();
|
$this->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clear
|
* clear
|
||||||
* clears all repositories
|
* clears all repositories
|
||||||
@ -906,6 +954,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
$table->clear();
|
$table->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* evictTables
|
* evictTables
|
||||||
* evicts all tables
|
* evicts all tables
|
||||||
@ -917,6 +966,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
$this->tables = array();
|
$this->tables = array();
|
||||||
$this->exported = array();
|
$this->exported = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* close
|
* close
|
||||||
* closes the connection
|
* closes the connection
|
||||||
@ -931,6 +981,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$this->getAttribute(Doctrine::ATTR_LISTENER)->onClose($this);
|
$this->getAttribute(Doctrine::ATTR_LISTENER)->onClose($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the current transaction nesting level
|
* get the current transaction nesting level
|
||||||
*
|
*
|
||||||
@ -940,6 +991,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->transaction->getTransactionLevel();
|
return $this->transaction->getTransactionLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* beginTransaction
|
* beginTransaction
|
||||||
* starts a new transaction
|
* starts a new transaction
|
||||||
@ -953,6 +1005,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
$this->transaction->beginTransaction();
|
$this->transaction->beginTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* commits the current transaction
|
* commits the current transaction
|
||||||
* if lockmode is optimistic this method starts a transaction
|
* if lockmode is optimistic this method starts a transaction
|
||||||
@ -964,6 +1017,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
$this->transaction->commit();
|
$this->transaction->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rollback
|
* rollback
|
||||||
* rolls back all transactions
|
* rolls back all transactions
|
||||||
@ -977,6 +1031,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
$this->transaction->rollback();
|
$this->transaction->rollback();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* saves the given record
|
* saves the given record
|
||||||
*
|
*
|
||||||
@ -1003,6 +1058,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$record->getTable()->getAttribute(Doctrine::ATTR_LISTENER)->onSave($record);
|
$record->getTable()->getAttribute(Doctrine::ATTR_LISTENER)->onSave($record);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deletes this data access object and all the related composites
|
* deletes this data access object and all the related composites
|
||||||
* this operation is isolated by a transaction
|
* this operation is isolated by a transaction
|
||||||
@ -1030,6 +1086,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a string representation of this object
|
* returns a string representation of this object
|
||||||
* @return string
|
* @return string
|
||||||
|
@ -42,18 +42,22 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
* constant for SELECT queries
|
* constant for SELECT queries
|
||||||
*/
|
*/
|
||||||
const SELECT = 0;
|
const SELECT = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constant for DELETE queries
|
* constant for DELETE queries
|
||||||
*/
|
*/
|
||||||
const DELETE = 1;
|
const DELETE = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constant for UPDATE queries
|
* constant for UPDATE queries
|
||||||
*/
|
*/
|
||||||
const UPDATE = 2;
|
const UPDATE = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constant for INSERT queries
|
* constant for INSERT queries
|
||||||
*/
|
*/
|
||||||
const INSERT = 3;
|
const INSERT = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constant for CREATE queries
|
* constant for CREATE queries
|
||||||
*/
|
*/
|
||||||
@ -63,15 +67,18 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
* @var array $params query input parameters
|
* @var array $params query input parameters
|
||||||
*/
|
*/
|
||||||
protected $_params = array();
|
protected $_params = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Connection $conn Doctrine_Connection object
|
* @var Doctrine_Connection $conn Doctrine_Connection object
|
||||||
*/
|
*/
|
||||||
protected $_conn;
|
protected $_conn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_View $_view Doctrine_View object, when set this object will use the
|
* @var Doctrine_View $_view Doctrine_View object, when set this object will use the
|
||||||
* the query given by the view object for object population
|
* the query given by the view object for object population
|
||||||
*/
|
*/
|
||||||
protected $_view;
|
protected $_view;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $_aliasMap two dimensional array containing the map for query aliases
|
* @var array $_aliasMap two dimensional array containing the map for query aliases
|
||||||
* Main keys are component aliases
|
* Main keys are component aliases
|
||||||
@ -85,15 +92,18 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
* agg the aggregates of this component
|
* agg the aggregates of this component
|
||||||
*/
|
*/
|
||||||
protected $_aliasMap = array();
|
protected $_aliasMap = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected $pendingAggregates = array();
|
protected $pendingAggregates = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $aggregateMap an array containing all aggregate aliases, keys as dql aliases
|
* @var array $aggregateMap an array containing all aggregate aliases, keys as dql aliases
|
||||||
* and values as sql aliases
|
* and values as sql aliases
|
||||||
*/
|
*/
|
||||||
protected $aggregateMap = array();
|
protected $aggregateMap = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $_options an array of options
|
* @var array $_options an array of options
|
||||||
*/
|
*/
|
||||||
@ -102,6 +112,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
'parserCache' => false,
|
'parserCache' => false,
|
||||||
'resultSetCache' => false,
|
'resultSetCache' => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $parts SQL query string parts
|
* @var array $parts SQL query string parts
|
||||||
*/
|
*/
|
||||||
@ -119,6 +130,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
'limit' => false,
|
'limit' => false,
|
||||||
'offset' => false,
|
'offset' => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $type the query type
|
* @var integer $type the query type
|
||||||
*
|
*
|
||||||
@ -129,12 +141,14 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
protected $_cache;
|
protected $_cache;
|
||||||
|
|
||||||
protected $_tableAliases = array();
|
protected $_tableAliases = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $_tableAliasSeeds A simple array keys representing table aliases and values
|
* @var array $_tableAliasSeeds A simple array keys representing table aliases and values
|
||||||
* as table alias seeds. The seeds are used for generating short table
|
* as table alias seeds. The seeds are used for generating short table
|
||||||
* aliases.
|
* aliases.
|
||||||
*/
|
*/
|
||||||
protected $_tableAliasSeeds = array();
|
protected $_tableAliasSeeds = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*
|
*
|
||||||
@ -160,6 +174,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
return $this->_cache;
|
return $this->_cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* serialize
|
* serialize
|
||||||
* this method is automatically called when this Doctrine_Hydrate is serialized
|
* this method is automatically called when this Doctrine_Hydrate is serialized
|
||||||
@ -171,6 +186,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
$vars = get_object_vars($this);
|
$vars = get_object_vars($this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unseralize
|
* unseralize
|
||||||
* this method is automatically called everytime a Doctrine_Hydrate object is unserialized
|
* this method is automatically called everytime a Doctrine_Hydrate object is unserialized
|
||||||
@ -182,6 +198,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generateNewTableAlias
|
* generateNewTableAlias
|
||||||
* generates a new alias from given table alias
|
* generates a new alias from given table alias
|
||||||
@ -207,6 +224,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $alias;
|
return $alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasTableAlias
|
* hasTableAlias
|
||||||
* whether or not this object has given tableAlias
|
* whether or not this object has given tableAlias
|
||||||
@ -218,6 +236,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
return (isset($this->_tableAliases[$tableAlias]));
|
return (isset($this->_tableAliases[$tableAlias]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getComponentAlias
|
* getComponentAlias
|
||||||
* get component alias associated with given table alias
|
* get component alias associated with given table alias
|
||||||
@ -232,6 +251,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
}
|
}
|
||||||
return $this->_tableAliases[$tableAlias];
|
return $this->_tableAliases[$tableAlias];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTableAliasSeed
|
* getTableAliasSeed
|
||||||
* returns the alias seed for given table alias
|
* returns the alias seed for given table alias
|
||||||
@ -246,6 +266,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
}
|
}
|
||||||
return $this->_tableAliasSeeds[$tableAlias];
|
return $this->_tableAliasSeeds[$tableAlias];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generateTableAlias
|
* generateTableAlias
|
||||||
* generates a table alias from given table name and associates
|
* generates a table alias from given table name and associates
|
||||||
@ -272,6 +293,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $alias;
|
return $alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTableAliases
|
* getTableAliases
|
||||||
* returns all table aliases
|
* returns all table aliases
|
||||||
@ -282,6 +304,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
return $this->_tableAliases;
|
return $this->_tableAliases;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addTableAlias
|
* addTableAlias
|
||||||
* adds an alias for table and associates it with given component alias
|
* adds an alias for table and associates it with given component alias
|
||||||
@ -296,6 +319,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTableAlias
|
* getTableAlias
|
||||||
* some database such as Oracle need the identifier lengths to be < ~30 chars
|
* some database such as Oracle need the identifier lengths to be < ~30 chars
|
||||||
@ -322,6 +346,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $this->generateTableAlias($componentAlias, $tableName);
|
return $this->generateTableAlias($componentAlias, $tableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addQueryPart
|
* addQueryPart
|
||||||
* adds a query part in the query part array
|
* adds a query part in the query part array
|
||||||
@ -340,6 +365,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setQueryPart
|
* setQueryPart
|
||||||
* sets a query part in the query part array
|
* sets a query part in the query part array
|
||||||
@ -357,6 +383,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $this->parts[$part];
|
return $this->parts[$part];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* removeQueryPart
|
* removeQueryPart
|
||||||
* removes a query part from the query part array
|
* removes a query part from the query part array
|
||||||
@ -378,6 +405,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setQueryPart
|
* setQueryPart
|
||||||
* sets a query part in the query part array
|
* sets a query part in the query part array
|
||||||
@ -401,6 +429,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAliasDeclaration
|
* getAliasDeclaration
|
||||||
* get the declaration for given component alias
|
* get the declaration for given component alias
|
||||||
@ -416,6 +445,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $this->_aliasMap[$componentAlias];
|
return $this->_aliasMap[$componentAlias];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* copyAliases
|
* copyAliases
|
||||||
* copy aliases from another Hydrate object
|
* copy aliases from another Hydrate object
|
||||||
@ -433,6 +463,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createSubquery
|
* createSubquery
|
||||||
* creates a subquery
|
* creates a subquery
|
||||||
@ -452,6 +483,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* limitSubqueryUsed
|
* limitSubqueryUsed
|
||||||
* whether or not limit subquery was used
|
* whether or not limit subquery was used
|
||||||
@ -462,6 +494,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clear
|
* clear
|
||||||
* resets all the variables
|
* resets all the variables
|
||||||
@ -486,6 +519,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
);
|
);
|
||||||
$this->inheritanceApplied = false;
|
$this->inheritanceApplied = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getConnection
|
* getConnection
|
||||||
*
|
*
|
||||||
@ -495,6 +529,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
return $this->_conn;
|
return $this->_conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setView
|
* setView
|
||||||
* sets a database view this query object uses
|
* sets a database view this query object uses
|
||||||
@ -507,6 +542,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
$this->_view = $view;
|
$this->_view = $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getView
|
* getView
|
||||||
* returns the view associated with this query object (if any)
|
* returns the view associated with this query object (if any)
|
||||||
@ -517,6 +553,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
return $this->_view;
|
return $this->_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getParams
|
* getParams
|
||||||
*
|
*
|
||||||
@ -526,6 +563,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
return $this->_params;
|
return $this->_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setParams
|
* setParams
|
||||||
*
|
*
|
||||||
@ -538,6 +576,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
return $params;
|
return $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setAliasMap
|
* setAliasMap
|
||||||
* sets the whole component alias map
|
* sets the whole component alias map
|
||||||
@ -551,6 +590,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAliasMap
|
* getAliasMap
|
||||||
* returns the component alias map
|
* returns the component alias map
|
||||||
@ -561,6 +601,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
return $this->_aliasMap;
|
return $this->_aliasMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mapAggregateValues
|
* mapAggregateValues
|
||||||
* map the aggregate values of given dataset row to a given record
|
* map the aggregate values of given dataset row to a given record
|
||||||
@ -634,6 +675,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
$stmt = $this->_conn->execute($query, $params);
|
$stmt = $this->_conn->execute($query, $params);
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute
|
* execute
|
||||||
* executes the query and populates the data set
|
* executes the query and populates the data set
|
||||||
@ -705,6 +747,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
{
|
{
|
||||||
return $this->type;
|
return $this->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* applyInheritance
|
* applyInheritance
|
||||||
* applies column aggregation inheritance to DQL / SQL query
|
* applies column aggregation inheritance to DQL / SQL query
|
||||||
@ -762,6 +805,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parseData
|
* parseData
|
||||||
* parses the data returned by statement object
|
* parses the data returned by statement object
|
||||||
@ -999,6 +1043,7 @@ class Doctrine_Hydrate implements Serializable
|
|||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string returns a string representation of this object
|
* @return string returns a string representation of this object
|
||||||
*/
|
*/
|
||||||
|
@ -42,6 +42,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return new Doctrine_Query();
|
return new Doctrine_Query();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addSelect
|
* addSelect
|
||||||
* adds fields to the SELECT part of the query
|
* adds fields to the SELECT part of the query
|
||||||
@ -53,6 +54,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('select')->parse($select, true);
|
return $this->getParser('select')->parse($select, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addWhere
|
* addWhere
|
||||||
* adds conditions to the WHERE part of the query
|
* adds conditions to the WHERE part of the query
|
||||||
@ -70,6 +72,7 @@ class Doctrine_Query
|
|||||||
}
|
}
|
||||||
return $this->getParser('where')->parse($where, true);
|
return $this->getParser('where')->parse($where, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addGroupBy
|
* addGroupBy
|
||||||
* adds fields to the GROUP BY part of the query
|
* adds fields to the GROUP BY part of the query
|
||||||
@ -81,6 +84,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('groupby')->parse($groupby, true);
|
return $this->getParser('groupby')->parse($groupby, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addHaving
|
* addHaving
|
||||||
* adds conditions to the HAVING part of the query
|
* adds conditions to the HAVING part of the query
|
||||||
@ -92,6 +96,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('having')->parse($having, true);
|
return $this->getParser('having')->parse($having, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addOrderBy
|
* addOrderBy
|
||||||
* adds fields to the ORDER BY part of the query
|
* adds fields to the ORDER BY part of the query
|
||||||
@ -103,6 +108,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('orderby')->parse($orderby, true);
|
return $this->getParser('orderby')->parse($orderby, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* select
|
* select
|
||||||
* sets the SELECT part of the query
|
* sets the SELECT part of the query
|
||||||
@ -114,6 +120,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('from')->parse($select);
|
return $this->getParser('from')->parse($select);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* from
|
* from
|
||||||
* sets the FROM part of the query
|
* sets the FROM part of the query
|
||||||
@ -125,6 +132,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('from')->parse($from);
|
return $this->getParser('from')->parse($from);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* innerJoin
|
* innerJoin
|
||||||
* appends an INNER JOIN to the FROM part of the query
|
* appends an INNER JOIN to the FROM part of the query
|
||||||
@ -136,6 +144,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('from')->parse('INNER JOIN ' . $join);
|
return $this->getParser('from')->parse('INNER JOIN ' . $join);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* leftJoin
|
* leftJoin
|
||||||
* appends a LEFT JOIN to the FROM part of the query
|
* appends a LEFT JOIN to the FROM part of the query
|
||||||
@ -147,6 +156,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('from')->parse('LERT JOIN ' . $join);
|
return $this->getParser('from')->parse('LERT JOIN ' . $join);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* groupBy
|
* groupBy
|
||||||
* sets the GROUP BY part of the query
|
* sets the GROUP BY part of the query
|
||||||
@ -158,6 +168,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('groupby')->parse($groupby);
|
return $this->getParser('groupby')->parse($groupby);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* where
|
* where
|
||||||
* sets the WHERE part of the query
|
* sets the WHERE part of the query
|
||||||
@ -175,6 +186,7 @@ class Doctrine_Query
|
|||||||
}
|
}
|
||||||
return $this->getParser('where')->parse($where);
|
return $this->getParser('where')->parse($where);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* having
|
* having
|
||||||
* sets the HAVING part of the query
|
* sets the HAVING part of the query
|
||||||
@ -192,6 +204,7 @@ class Doctrine_Query
|
|||||||
}
|
}
|
||||||
return $this->getParser('having')->parse($having);
|
return $this->getParser('having')->parse($having);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* orderBy
|
* orderBy
|
||||||
* sets the ORDER BY part of the query
|
* sets the ORDER BY part of the query
|
||||||
@ -203,6 +216,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('orderby')->parse($dql);
|
return $this->getParser('orderby')->parse($dql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* limit
|
* limit
|
||||||
* sets the DQL query limit
|
* sets the DQL query limit
|
||||||
@ -214,6 +228,7 @@ class Doctrine_Query
|
|||||||
{
|
{
|
||||||
return $this->getParser('limit')->parse($dql);
|
return $this->getParser('limit')->parse($dql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* offset
|
* offset
|
||||||
* sets the DQL query offset
|
* sets the DQL query offset
|
||||||
|
@ -36,6 +36,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate
|
|||||||
* @var array $fields
|
* @var array $fields
|
||||||
*/
|
*/
|
||||||
private $fields;
|
private $fields;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __call
|
* __call
|
||||||
* method overloader
|
* method overloader
|
||||||
@ -59,6 +60,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate
|
|||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get
|
* get
|
||||||
*/
|
*/
|
||||||
@ -69,6 +71,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate
|
|||||||
}
|
}
|
||||||
return $this->parts[$name];
|
return $this->parts[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parseQuery
|
* parseQuery
|
||||||
*
|
*
|
||||||
@ -126,6 +129,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getQuery
|
* getQuery
|
||||||
*
|
*
|
||||||
@ -191,6 +195,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate
|
|||||||
}
|
}
|
||||||
return $q;
|
return $q;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getFields
|
* getFields
|
||||||
*
|
*
|
||||||
@ -200,6 +205,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate
|
|||||||
{
|
{
|
||||||
return $this->fields;
|
return $this->fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addComponent
|
* addComponent
|
||||||
*
|
*
|
||||||
|
@ -42,33 +42,39 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
* a Doctrine_Record is in dirty state when its properties are changed
|
* a Doctrine_Record is in dirty state when its properties are changed
|
||||||
*/
|
*/
|
||||||
const STATE_DIRTY = 1;
|
const STATE_DIRTY = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TDIRTY STATE
|
* TDIRTY STATE
|
||||||
* a Doctrine_Record is in transient dirty state when it is created and some of its fields are modified
|
* a Doctrine_Record is in transient dirty state when it is created and some of its fields are modified
|
||||||
* but it is NOT yet persisted into database
|
* but it is NOT yet persisted into database
|
||||||
*/
|
*/
|
||||||
const STATE_TDIRTY = 2;
|
const STATE_TDIRTY = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CLEAN STATE
|
* CLEAN STATE
|
||||||
* a Doctrine_Record is in clean state when all of its properties are loaded from the database
|
* a Doctrine_Record is in clean state when all of its properties are loaded from the database
|
||||||
* and none of its properties are changed
|
* and none of its properties are changed
|
||||||
*/
|
*/
|
||||||
const STATE_CLEAN = 3;
|
const STATE_CLEAN = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PROXY STATE
|
* PROXY STATE
|
||||||
* a Doctrine_Record is in proxy state when its properties are not fully loaded
|
* a Doctrine_Record is in proxy state when its properties are not fully loaded
|
||||||
*/
|
*/
|
||||||
const STATE_PROXY = 4;
|
const STATE_PROXY = 4;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NEW TCLEAN
|
* NEW TCLEAN
|
||||||
* a Doctrine_Record is in transient clean state when it is created and none of its fields are modified
|
* a Doctrine_Record is in transient clean state when it is created and none of its fields are modified
|
||||||
*/
|
*/
|
||||||
const STATE_TCLEAN = 5;
|
const STATE_TCLEAN = 5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DELETED STATE
|
* DELETED STATE
|
||||||
* a Doctrine_Record turns into deleted state when it is deleted
|
* a Doctrine_Record turns into deleted state when it is deleted
|
||||||
*/
|
*/
|
||||||
const STATE_DELETED = 6;
|
const STATE_DELETED = 6;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the following protected variables use '_' prefixes, the reason for this is to allow child
|
* the following protected variables use '_' prefixes, the reason for this is to allow child
|
||||||
* classes call for example $this->id, $this->state for getting the values of columns named 'id' and 'state'
|
* classes call for example $this->id, $this->state for getting the values of columns named 'id' and 'state'
|
||||||
@ -78,48 +84,59 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
* @var object Doctrine_Table $_table the factory that created this data access object
|
* @var object Doctrine_Table $_table the factory that created this data access object
|
||||||
*/
|
*/
|
||||||
protected $_table;
|
protected $_table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Node_<TreeImpl> node object
|
* @var Doctrine_Node_<TreeImpl> node object
|
||||||
*/
|
*/
|
||||||
protected $_node;
|
protected $_node;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $_id the primary keys of this object
|
* @var integer $_id the primary keys of this object
|
||||||
*/
|
*/
|
||||||
protected $_id = array();
|
protected $_id = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $_data the record data
|
* @var array $_data the record data
|
||||||
*/
|
*/
|
||||||
protected $_data = array();
|
protected $_data = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $_values the values array, aggregate values and such are mapped into this array
|
* @var array $_values the values array, aggregate values and such are mapped into this array
|
||||||
*/
|
*/
|
||||||
protected $_values = array();
|
protected $_values = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $_state the state of this record
|
* @var integer $_state the state of this record
|
||||||
* @see STATE_* constants
|
* @see STATE_* constants
|
||||||
*/
|
*/
|
||||||
protected $_state;
|
protected $_state;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $_modified an array containing properties that have been modified
|
* @var array $_modified an array containing properties that have been modified
|
||||||
*/
|
*/
|
||||||
protected $_modified = array();
|
protected $_modified = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Validator_ErrorStack error stack object
|
* @var Doctrine_Validator_ErrorStack error stack object
|
||||||
*/
|
*/
|
||||||
protected $_errorStack;
|
protected $_errorStack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $references an array containing all the references
|
* @var array $references an array containing all the references
|
||||||
*/
|
*/
|
||||||
private $references = array();
|
private $references = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $index this index is used for creating object identifiers
|
* @var integer $index this index is used for creating object identifiers
|
||||||
*/
|
*/
|
||||||
private static $index = 1;
|
private static $index = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Null $null a Doctrine_Null object used for extremely fast
|
* @var Doctrine_Null $null a Doctrine_Null object used for extremely fast
|
||||||
* null value testing
|
* null value testing
|
||||||
*/
|
*/
|
||||||
private static $null;
|
private static $null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $oid object identifier, each Record object has a unique object identifier
|
* @var integer $oid object identifier, each Record object has a unique object identifier
|
||||||
*/
|
*/
|
||||||
@ -211,6 +228,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
$this->construct();
|
$this->construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initNullObject
|
* initNullObject
|
||||||
*
|
*
|
||||||
@ -221,6 +239,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
self::$null = $null;
|
self::$null = $null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Doctrine_Null
|
* @return Doctrine_Null
|
||||||
*/
|
*/
|
||||||
@ -228,6 +247,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return self::$null;
|
return self::$null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setUp
|
* setUp
|
||||||
* this method is used for setting up relations and attributes
|
* this method is used for setting up relations and attributes
|
||||||
@ -256,6 +276,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return $this->oid;
|
return $this->oid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* isValid
|
* isValid
|
||||||
*
|
*
|
||||||
@ -281,6 +302,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
return $this->_errorStack->count() == 0 ? true : false;
|
return $this->_errorStack->count() == 0 ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Emtpy template method to provide concrete Record classes with the possibility
|
* Emtpy template method to provide concrete Record classes with the possibility
|
||||||
* to hook into the validation procedure, doing any custom / specialized
|
* to hook into the validation procedure, doing any custom / specialized
|
||||||
@ -311,6 +333,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return $this->_errorStack;
|
return $this->_errorStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* errorStack
|
* errorStack
|
||||||
* assigns / returns record errorStack
|
* assigns / returns record errorStack
|
||||||
@ -329,6 +352,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
return $this->_errorStack;
|
return $this->_errorStack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setDefaultValues
|
* setDefaultValues
|
||||||
* sets the default values for records internal data
|
* sets the default values for records internal data
|
||||||
@ -354,6 +378,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cleanData
|
* cleanData
|
||||||
* this method does several things to records internal data
|
* this method does several things to records internal data
|
||||||
@ -429,6 +454,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
return $count;
|
return $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hydrate
|
* hydrate
|
||||||
* hydrates this object from given array
|
* hydrates this object from given array
|
||||||
@ -444,6 +470,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
$this->cleanData();
|
$this->cleanData();
|
||||||
$this->prepareIdentifiers();
|
$this->prepareIdentifiers();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prepareIdentifiers
|
* prepareIdentifiers
|
||||||
* prepares identifiers for later use
|
* prepares identifiers for later use
|
||||||
@ -488,6 +515,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* serialize
|
* serialize
|
||||||
* this method is automatically called when this Doctrine_Record is serialized
|
* this method is automatically called when this Doctrine_Record is serialized
|
||||||
@ -525,6 +553,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
return serialize($vars);
|
return serialize($vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unseralize
|
* unseralize
|
||||||
* this method is automatically called everytime a Doctrine_Record object is unserialized
|
* this method is automatically called everytime a Doctrine_Record object is unserialized
|
||||||
@ -557,6 +586,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
$this->_table->getAttribute(Doctrine::ATTR_LISTENER)->onWakeUp($this);
|
$this->_table->getAttribute(Doctrine::ATTR_LISTENER)->onWakeUp($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getState
|
* getState
|
||||||
* returns the current state of the object
|
* returns the current state of the object
|
||||||
@ -568,6 +598,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return $this->_state;
|
return $this->_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* state
|
* state
|
||||||
* returns / assigns the state of this record
|
* returns / assigns the state of this record
|
||||||
@ -611,6 +642,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
throw new Doctrine_Record_State_Exception('Unknown record state ' . $state);
|
throw new Doctrine_Record_State_Exception('Unknown record state ' . $state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* refresh
|
* refresh
|
||||||
* refresh internal data from the database
|
* refresh internal data from the database
|
||||||
@ -651,6 +683,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* factoryRefresh
|
* factoryRefresh
|
||||||
* refreshes the data from outer source (Doctrine_Table)
|
* refreshes the data from outer source (Doctrine_Table)
|
||||||
@ -676,6 +709,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
$this->_table->getAttribute(Doctrine::ATTR_LISTENER)->onLoad($this);
|
$this->_table->getAttribute(Doctrine::ATTR_LISTENER)->onLoad($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTable
|
* getTable
|
||||||
* returns the table object for this record
|
* returns the table object for this record
|
||||||
@ -686,6 +720,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return $this->_table;
|
return $this->_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getData
|
* getData
|
||||||
* return all the internal data
|
* return all the internal data
|
||||||
@ -696,6 +731,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return $this->_data;
|
return $this->_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rawGet
|
* rawGet
|
||||||
* returns the value of a property, if the property is not yet loaded
|
* returns the value of a property, if the property is not yet loaded
|
||||||
@ -715,6 +751,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
return $this->_data[$name];
|
return $this->_data[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* load
|
* load
|
||||||
* loads all the unitialized properties from the database
|
* loads all the unitialized properties from the database
|
||||||
@ -733,6 +770,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get
|
* get
|
||||||
* returns a value of a property or a related component
|
* returns a value of a property or a related component
|
||||||
@ -793,6 +831,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
return $this->references[$name];
|
return $this->references[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mapValue
|
* mapValue
|
||||||
* This simple method is used for mapping values to $values property.
|
* This simple method is used for mapping values to $values property.
|
||||||
@ -808,6 +847,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
$name = strtolower($name);
|
$name = strtolower($name);
|
||||||
$this->_values[$name] = $value;
|
$this->_values[$name] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set
|
* set
|
||||||
* method for altering properties and Doctrine_Record references
|
* method for altering properties and Doctrine_Record references
|
||||||
@ -905,6 +945,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
$this->references[$name] = $value;
|
$this->references[$name] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* contains
|
* contains
|
||||||
*
|
*
|
||||||
@ -926,6 +967,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @return void
|
* @return void
|
||||||
@ -937,6 +979,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
// todo: what to do with references ?
|
// todo: what to do with references ?
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* applies the changes made to this object into database
|
* applies the changes made to this object into database
|
||||||
* this method is smart enough to know if any changes are made
|
* this method is smart enough to know if any changes are made
|
||||||
@ -979,6 +1022,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
$conn->commit();
|
$conn->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to save the object and all its related components.
|
* Tries to save the object and all its related components.
|
||||||
* In contrast to Doctrine_Record::save(), this method does not
|
* In contrast to Doctrine_Record::save(), this method does not
|
||||||
@ -996,6 +1040,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* replace
|
* replace
|
||||||
* Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT
|
* Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT
|
||||||
@ -1022,6 +1067,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
return $conn->replace($this->_table->getTableName(), $this->getPrepared(), $this->id);
|
return $conn->replace($this->_table->getTableName(), $this->getPrepared(), $this->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an array of modified fields and associated values
|
* returns an array of modified fields and associated values
|
||||||
* @return array
|
* @return array
|
||||||
@ -1035,6 +1081,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getPrepared
|
* getPrepared
|
||||||
*
|
*
|
||||||
@ -1091,6 +1138,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count
|
* count
|
||||||
* this class implements countable interface
|
* this class implements countable interface
|
||||||
@ -1101,6 +1149,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return count($this->_data);
|
return count($this->_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* alias for count()
|
* alias for count()
|
||||||
*
|
*
|
||||||
@ -1110,6 +1159,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return $this->count();
|
return $this->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* toArray
|
* toArray
|
||||||
* returns the record as an array
|
* returns the record as an array
|
||||||
@ -1129,6 +1179,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exists
|
* exists
|
||||||
* returns true if this record is persistent, otherwise false
|
* returns true if this record is persistent, otherwise false
|
||||||
@ -1140,6 +1191,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
return ($this->_state !== Doctrine_Record::STATE_TCLEAN &&
|
return ($this->_state !== Doctrine_Record::STATE_TCLEAN &&
|
||||||
$this->_state !== Doctrine_Record::STATE_TDIRTY);
|
$this->_state !== Doctrine_Record::STATE_TDIRTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* method for checking existence of properties and Doctrine_Record references
|
* method for checking existence of properties and Doctrine_Record references
|
||||||
* @param mixed $name name of the property or reference
|
* @param mixed $name name of the property or reference
|
||||||
@ -1152,6 +1204,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
return $this->_table->hasRelation($name);
|
return $this->_table->hasRelation($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getIterator
|
* getIterator
|
||||||
* @return Doctrine_Record_Iterator a Doctrine_Record_Iterator that iterates through the data
|
* @return Doctrine_Record_Iterator a Doctrine_Record_Iterator that iterates through the data
|
||||||
@ -1160,6 +1213,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return new Doctrine_Record_Iterator($this);
|
return new Doctrine_Record_Iterator($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deletes this data access object and all the related composites
|
* deletes this data access object and all the related composites
|
||||||
* this operation is isolated by a transaction
|
* this operation is isolated by a transaction
|
||||||
@ -1175,6 +1229,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
return $conn->delete($this);
|
return $conn->delete($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* copy
|
* copy
|
||||||
* returns a copy of this object
|
* returns a copy of this object
|
||||||
@ -1192,6 +1247,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* copyDeep
|
* copyDeep
|
||||||
* returns a copy of this object and all its related objects
|
* returns a copy of this object and all its related objects
|
||||||
@ -1212,7 +1268,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
return $copy;
|
return $copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* assignIdentifier
|
* assignIdentifier
|
||||||
*
|
*
|
||||||
@ -1238,6 +1294,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
$this->_modified = array();
|
$this->_modified = array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the primary keys of this object
|
* returns the primary keys of this object
|
||||||
*
|
*
|
||||||
@ -1247,6 +1304,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return $this->_id;
|
return $this->_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the value of autoincremented primary key of this object (if any)
|
* returns the value of autoincremented primary key of this object (if any)
|
||||||
*
|
*
|
||||||
@ -1260,6 +1318,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getLast
|
* getLast
|
||||||
* this method is used internally be Doctrine_Query
|
* this method is used internally be Doctrine_Query
|
||||||
@ -1272,6 +1331,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasRefence
|
* hasRefence
|
||||||
* @param string $name
|
* @param string $name
|
||||||
@ -1281,6 +1341,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return isset($this->references[$name]);
|
return isset($this->references[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* obtainReference
|
* obtainReference
|
||||||
*
|
*
|
||||||
@ -1294,6 +1355,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
throw new Doctrine_Record_Exception("Unknown reference $name");
|
throw new Doctrine_Record_Exception("Unknown reference $name");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initalizes a one-to-many / many-to-many relation
|
* initalizes a one-to-many / many-to-many relation
|
||||||
*
|
*
|
||||||
@ -1319,6 +1381,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getReferences
|
* getReferences
|
||||||
* @return array all references
|
* @return array all references
|
||||||
@ -1327,6 +1390,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return $this->references;
|
return $this->references;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loadReference
|
* loadReference
|
||||||
* loads a related component
|
* loads a related component
|
||||||
@ -1348,6 +1412,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
$this->references[$name] = $coll;
|
$this->references[$name] = $coll;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* binds One-to-One composite relation
|
* binds One-to-One composite relation
|
||||||
*
|
*
|
||||||
@ -1359,6 +1424,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
$this->_table->bind($componentName, $foreignKey, Doctrine_Relation::ONE_COMPOSITE, $options);
|
$this->_table->bind($componentName, $foreignKey, Doctrine_Relation::ONE_COMPOSITE, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* binds One-to-Many composite relation
|
* binds One-to-Many composite relation
|
||||||
*
|
*
|
||||||
@ -1370,6 +1436,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
$this->_table->bind($componentName, $foreignKey, Doctrine_Relation::MANY_COMPOSITE, $options);
|
$this->_table->bind($componentName, $foreignKey, Doctrine_Relation::MANY_COMPOSITE, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* binds One-to-One aggregate relation
|
* binds One-to-One aggregate relation
|
||||||
*
|
*
|
||||||
@ -1381,6 +1448,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
$this->_table->bind($componentName, $foreignKey, Doctrine_Relation::ONE_AGGREGATE, $options);
|
$this->_table->bind($componentName, $foreignKey, Doctrine_Relation::ONE_AGGREGATE, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* binds One-to-Many aggregate relation
|
* binds One-to-Many aggregate relation
|
||||||
*
|
*
|
||||||
@ -1392,6 +1460,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
$this->_table->bind($componentName, $foreignKey, Doctrine_Relation::MANY_AGGREGATE, $options);
|
$this->_table->bind($componentName, $foreignKey, Doctrine_Relation::MANY_AGGREGATE, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasColumn
|
* hasColumn
|
||||||
* sets a column definition
|
* sets a column definition
|
||||||
@ -1406,6 +1475,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
$this->_table->setColumn($name, $type, $length, $options);
|
$this->_table->setColumn($name, $type, $length, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* countRelated
|
* countRelated
|
||||||
*
|
*
|
||||||
@ -1422,6 +1492,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
$array = $query->execute(array($this->getIncremented()));
|
$array = $query->execute(array($this->getIncremented()));
|
||||||
return $array[0]['COUNT(1)'];
|
return $array[0]['COUNT(1)'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* merge
|
* merge
|
||||||
* merges this record with an array of values
|
* merges this record with an array of values
|
||||||
@ -1457,6 +1528,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
$this->_table->setEnumValues($column, $values);
|
$this->_table->setEnumValues($column, $values);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* attribute
|
* attribute
|
||||||
* sets or retrieves an option
|
* sets or retrieves an option
|
||||||
@ -1480,6 +1552,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
$this->_table->setAttribute($attr, $value);
|
$this->_table->setAttribute($attr, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* option
|
* option
|
||||||
* sets or retrieves an option
|
* sets or retrieves an option
|
||||||
@ -1503,6 +1576,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
$this->_table->setOption($name, $value);
|
$this->_table->setOption($name, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* index
|
* index
|
||||||
* defines or retrieves an index
|
* defines or retrieves an index
|
||||||
@ -1521,6 +1595,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
return $this->_table->addIndex($name, $definition);
|
return $this->_table->addIndex($name, $definition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addListener
|
* addListener
|
||||||
*
|
*
|
||||||
@ -1532,6 +1607,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
$this->_table->addListener($listener, $name = null);
|
$this->_table->addListener($listener, $name = null);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getListener
|
* getListener
|
||||||
*
|
*
|
||||||
@ -1541,6 +1617,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
{
|
{
|
||||||
return $this->_table->getListener();
|
return $this->_table->getListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setListener
|
* setListener
|
||||||
*
|
*
|
||||||
@ -1552,6 +1629,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
$this->_table->setListener($listener);
|
$this->_table->setListener($listener);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* call
|
* call
|
||||||
*
|
*
|
||||||
@ -1575,6 +1653,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getter for node assciated with this record
|
* getter for node assciated with this record
|
||||||
*
|
*
|
||||||
@ -1595,6 +1674,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
|
|
||||||
return $this->_node;
|
return $this->_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE
|
* used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE
|
||||||
*
|
*
|
||||||
@ -1602,6 +1682,7 @@ abstract class Doctrine_Record2 extends Doctrine_Access implements Countable, It
|
|||||||
public function deleteNode() {
|
public function deleteNode() {
|
||||||
$this->getNode()->delete();
|
$this->getNode()->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a string representation of this object
|
* returns a string representation of this object
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Table
|
* Doctrine_Table
|
||||||
*
|
*
|
||||||
@ -39,39 +40,48 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
* @var array $data temporary data which is then loaded into Doctrine_Record::$data
|
* @var array $data temporary data which is then loaded into Doctrine_Record::$data
|
||||||
*/
|
*/
|
||||||
private $data = array();
|
private $data = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $relations an array containing all the Doctrine_Relation objects for this table
|
* @var array $relations an array containing all the Doctrine_Relation objects for this table
|
||||||
*/
|
*/
|
||||||
private $relations = array();
|
private $relations = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $primaryKeys an array containing all primary key column names
|
* @var array $primaryKeys an array containing all primary key column names
|
||||||
*/
|
*/
|
||||||
private $primaryKeys = array();
|
private $primaryKeys = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var mixed $identifier
|
* @var mixed $identifier
|
||||||
*/
|
*/
|
||||||
private $identifier;
|
private $identifier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Doctrine_Identifier constants
|
* @see Doctrine_Identifier constants
|
||||||
* @var integer $identifierType the type of identifier this table uses
|
* @var integer $identifierType the type of identifier this table uses
|
||||||
*/
|
*/
|
||||||
private $identifierType;
|
private $identifierType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Connection $conn Doctrine_Connection object that created this table
|
* @var Doctrine_Connection $conn Doctrine_Connection object that created this table
|
||||||
*/
|
*/
|
||||||
private $conn;
|
private $conn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $name
|
* @var string $name
|
||||||
*/
|
*/
|
||||||
private $name;
|
private $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $identityMap first level cache
|
* @var array $identityMap first level cache
|
||||||
*/
|
*/
|
||||||
private $identityMap = array();
|
private $identityMap = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Table_Repository $repository record repository
|
* @var Doctrine_Table_Repository $repository record repository
|
||||||
*/
|
*/
|
||||||
private $repository;
|
private $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $columns an array of column definitions,
|
* @var array $columns an array of column definitions,
|
||||||
* keys as column names and values as column definitions
|
* keys as column names and values as column definitions
|
||||||
@ -89,28 +99,34 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
protected $columns = array();
|
protected $columns = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $columnAliases an array of column aliases
|
* @var array $columnAliases an array of column aliases
|
||||||
* keys as column aliases and values as column names
|
* keys as column aliases and values as column names
|
||||||
*/
|
*/
|
||||||
protected $columnAliases = array();
|
protected $columnAliases = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $bound bound relations
|
* @var array $bound bound relations
|
||||||
*/
|
*/
|
||||||
private $bound = array();
|
private $bound = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $boundAliases bound relation aliases
|
* @var array $boundAliases bound relation aliases
|
||||||
*/
|
*/
|
||||||
private $boundAliases = array();
|
private $boundAliases = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $columnCount cached column count, Doctrine_Record uses this column count in when
|
* @var integer $columnCount cached column count, Doctrine_Record uses this column count in when
|
||||||
* determining its state
|
* determining its state
|
||||||
*/
|
*/
|
||||||
private $columnCount;
|
private $columnCount;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $hasDefaultValues whether or not this table has default values
|
* @var boolean $hasDefaultValues whether or not this table has default values
|
||||||
*/
|
*/
|
||||||
private $hasDefaultValues;
|
private $hasDefaultValues;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $options an array containing all options
|
* @var array $options an array containing all options
|
||||||
*
|
*
|
||||||
@ -160,10 +176,12 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
'treeOptions' => null,
|
'treeOptions' => null,
|
||||||
'indexes' => array(),
|
'indexes' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Tree $tree tree object associated with this table
|
* @var Doctrine_Tree $tree tree object associated with this table
|
||||||
*/
|
*/
|
||||||
protected $tree;
|
protected $tree;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the constructor
|
* the constructor
|
||||||
* @throws Doctrine_Connection_Exception if there are no opened connections
|
* @throws Doctrine_Connection_Exception if there are no opened connections
|
||||||
@ -301,6 +319,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
|
|
||||||
$this->repository = new Doctrine_Table_Repository($this);
|
$this->repository = new Doctrine_Table_Repository($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* export
|
* export
|
||||||
* exports this table to database based on column and option definitions
|
* exports this table to database based on column and option definitions
|
||||||
@ -373,6 +392,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportConstraints
|
* exportConstraints
|
||||||
* exports the constraints of this table into database based on option definitions
|
* exports the constraints of this table into database based on option definitions
|
||||||
@ -395,6 +415,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __get
|
* __get
|
||||||
* an alias for getOption
|
* an alias for getOption
|
||||||
@ -408,6 +429,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __isset
|
* __isset
|
||||||
*
|
*
|
||||||
@ -417,6 +439,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return isset($this->options[$option]);
|
return isset($this->options[$option]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addForeignKey
|
* addForeignKey
|
||||||
*
|
*
|
||||||
@ -428,6 +451,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
$this->options['foreignKeys'][] = $definition;
|
$this->options['foreignKeys'][] = $definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addIndex
|
* addIndex
|
||||||
*
|
*
|
||||||
@ -440,6 +464,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
$index = $this->conn->getIndexName($index);
|
$index = $this->conn->getIndexName($index);
|
||||||
$this->options['indexes'][$index] = $definition;
|
$this->options['indexes'][$index] = $definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getIndex
|
* getIndex
|
||||||
*
|
*
|
||||||
@ -453,6 +478,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createQuery
|
* createQuery
|
||||||
* creates a new Doctrine_Query object and adds the component name
|
* creates a new Doctrine_Query object and adds the component name
|
||||||
@ -464,6 +490,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return Doctrine_Query::create()->from($this->getComponentName());
|
return Doctrine_Query::create()->from($this->getComponentName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getRepository
|
* getRepository
|
||||||
*
|
*
|
||||||
@ -498,6 +525,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getColumnName
|
* getColumnName
|
||||||
*
|
*
|
||||||
@ -516,6 +544,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
|
|
||||||
return $alias;
|
return $alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setColumn
|
* setColumn
|
||||||
*
|
*
|
||||||
@ -567,6 +596,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
$this->hasDefaultValues = true;
|
$this->hasDefaultValues = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasDefaultValues
|
* hasDefaultValues
|
||||||
* returns true if this table has default values, otherwise false
|
* returns true if this table has default values, otherwise false
|
||||||
@ -577,6 +607,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return $this->hasDefaultValues;
|
return $this->hasDefaultValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDefaultValueOf
|
* getDefaultValueOf
|
||||||
* returns the default value(if any) for given column
|
* returns the default value(if any) for given column
|
||||||
@ -596,6 +627,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
@ -603,6 +635,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return $this->identifier;
|
return $this->identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
@ -610,6 +643,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return $this->identifierType;
|
return $this->identifierType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasColumn
|
* hasColumn
|
||||||
* @return boolean
|
* @return boolean
|
||||||
@ -618,6 +652,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return isset($this->columns[$name]);
|
return isset($this->columns[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $key
|
* @param mixed $key
|
||||||
* @return void
|
* @return void
|
||||||
@ -633,6 +668,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns all primary keys
|
* returns all primary keys
|
||||||
* @return array
|
* @return array
|
||||||
@ -641,6 +677,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return $this->primaryKeys;
|
return $this->primaryKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
@ -648,6 +685,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return in_array($key,$this->primaryKeys);
|
return in_array($key,$this->primaryKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns all bound relations
|
* returns all bound relations
|
||||||
*
|
*
|
||||||
@ -657,6 +695,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return $this->bound;
|
return $this->bound;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a bound relation array
|
* returns a bound relation array
|
||||||
*
|
*
|
||||||
@ -670,6 +709,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return $this->bound[$name];
|
return $this->bound[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a bound relation array
|
* returns a bound relation array
|
||||||
*
|
*
|
||||||
@ -687,6 +727,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
throw new Doctrine_Table_Exception('Unknown bound ' . $name);
|
throw new Doctrine_Table_Exception('Unknown bound ' . $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the alias for given component name
|
* returns the alias for given component name
|
||||||
*
|
*
|
||||||
@ -700,6 +741,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns component name for given alias
|
* returns component name for given alias
|
||||||
*
|
*
|
||||||
@ -713,6 +755,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return $alias;
|
return $alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unbinds all relations
|
* unbinds all relations
|
||||||
*
|
*
|
||||||
@ -724,6 +767,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
$this->relations = array();
|
$this->relations = array();
|
||||||
$this->boundAliases = array();
|
$this->boundAliases = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unbinds a relation
|
* unbinds a relation
|
||||||
* returns true on success, false on failure
|
* returns true on success, false on failure
|
||||||
@ -746,6 +790,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* binds a relation
|
* binds a relation
|
||||||
*
|
*
|
||||||
@ -790,6 +835,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
$this->bound[$alias] = array_merge($this->bound[$alias], $opt);
|
$this->bound[$alias] = array_merge($this->bound[$alias], $opt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Doctrine_Connection
|
* @return Doctrine_Connection
|
||||||
*/
|
*/
|
||||||
@ -797,6 +843,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return $this->conn;
|
return $this->conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasRelatedComponent
|
* hasRelatedComponent
|
||||||
* @return boolean
|
* @return boolean
|
||||||
@ -805,6 +852,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return (strpos($this->bound[$name]['field'], $component . '.') !== false);
|
return (strpos($this->bound[$name]['field'], $component . '.') !== false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name component name of which a foreign key object is bound
|
* @param string $name component name of which a foreign key object is bound
|
||||||
* @return boolean
|
* @return boolean
|
||||||
@ -821,6 +869,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getRelation
|
* getRelation
|
||||||
*
|
*
|
||||||
@ -985,6 +1034,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an array containing all foreign key objects
|
* returns an array containing all foreign key objects
|
||||||
*
|
*
|
||||||
@ -998,6 +1048,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
|
|
||||||
return $this->relations;
|
return $this->relations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create
|
* create
|
||||||
* creates a new record
|
* creates a new record
|
||||||
@ -1011,6 +1062,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
$this->data = array();
|
$this->data = array();
|
||||||
return $record;
|
return $record;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* finds a record by its identifier
|
* finds a record by its identifier
|
||||||
*
|
*
|
||||||
@ -1042,6 +1094,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* applyInheritance
|
* applyInheritance
|
||||||
* @param $where query where part to be modified
|
* @param $where query where part to be modified
|
||||||
@ -1059,6 +1112,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return $where;
|
return $where;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* findAll
|
* findAll
|
||||||
* returns a collection of records
|
* returns a collection of records
|
||||||
@ -1071,6 +1125,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
$users = $graph->query("FROM ".$this->options['name']);
|
$users = $graph->query("FROM ".$this->options['name']);
|
||||||
return $users;
|
return $users;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* findByDql
|
* findByDql
|
||||||
* finds records with given DQL where clause
|
* finds records with given DQL where clause
|
||||||
@ -1089,6 +1144,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
public function findByDql($dql, array $params = array()) {
|
public function findByDql($dql, array $params = array()) {
|
||||||
return $this->findBySql($dql, $params);
|
return $this->findBySql($dql, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clear
|
* clear
|
||||||
* clears the first level cache (identityMap)
|
* clears the first level cache (identityMap)
|
||||||
@ -1099,6 +1155,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
$this->identityMap = array();
|
$this->identityMap = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getRecord
|
* getRecord
|
||||||
* first checks if record exists in identityMap, if not
|
* first checks if record exists in identityMap, if not
|
||||||
@ -1154,7 +1211,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
*/
|
*/
|
||||||
public function getClassnameToReturn()
|
public function getClassnameToReturn()
|
||||||
{
|
{
|
||||||
if (!isset($this->options['subclasses'])) {
|
if ( ! isset($this->options['subclasses'])) {
|
||||||
return $this->options['name'];
|
return $this->options['name'];
|
||||||
}
|
}
|
||||||
foreach ($this->options['subclasses'] as $subclass) {
|
foreach ($this->options['subclasses'] as $subclass) {
|
||||||
@ -1162,7 +1219,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
$inheritanceMap = $table->getOption('inheritanceMap');
|
$inheritanceMap = $table->getOption('inheritanceMap');
|
||||||
$nomatch = false;
|
$nomatch = false;
|
||||||
foreach ($inheritanceMap as $key => $value) {
|
foreach ($inheritanceMap as $key => $value) {
|
||||||
if (!isset($this->data[$key]) || $this->data[$key] != $value) {
|
if ( ! isset($this->data[$key]) || $this->data[$key] != $value) {
|
||||||
$nomatch = true;
|
$nomatch = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1195,6 +1252,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return $this->getRecord();
|
return $this->getRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count
|
* count
|
||||||
*
|
*
|
||||||
@ -1205,6 +1263,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
$a = $this->conn->getDBH()->query("SELECT COUNT(1) FROM ".$this->options['tableName'])->fetch(PDO::FETCH_NUM);
|
$a = $this->conn->getDBH()->query("SELECT COUNT(1) FROM ".$this->options['tableName'])->fetch(PDO::FETCH_NUM);
|
||||||
return current($a);
|
return current($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Doctrine_Query a Doctrine_Query object
|
* @return Doctrine_Query a Doctrine_Query object
|
||||||
*/
|
*/
|
||||||
@ -1214,6 +1273,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
$graph->load($this->getComponentName());
|
$graph->load($this->getComponentName());
|
||||||
return $graph;
|
return $graph;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute
|
* execute
|
||||||
* @param string $query
|
* @param string $query
|
||||||
@ -1240,6 +1300,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return $coll;
|
return $coll;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $field
|
* @param string $field
|
||||||
* @return array
|
* @return array
|
||||||
@ -1252,6 +1313,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enumValue
|
* enumValue
|
||||||
*
|
*
|
||||||
@ -1266,6 +1328,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
|
|
||||||
return isset($this->columns[$field][2]['values'][$index]) ? $this->columns[$field][2]['values'][$index] : $index;
|
return isset($this->columns[$field][2]['values'][$index]) ? $this->columns[$field][2]['values'][$index] : $index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enumIndex
|
* enumIndex
|
||||||
*
|
*
|
||||||
@ -1279,6 +1342,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
|
|
||||||
return array_search($value, $values);
|
return array_search($value, $values);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* invokeSet
|
* invokeSet
|
||||||
*
|
*
|
||||||
@ -1290,7 +1354,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
$prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_SET);
|
$prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_SET);
|
||||||
if (!$prefix)
|
if ( ! $prefix)
|
||||||
$prefix = 'set';
|
$prefix = 'set';
|
||||||
|
|
||||||
$method = $prefix . $name;
|
$method = $prefix . $name;
|
||||||
@ -1301,6 +1365,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* invokeGet
|
* invokeGet
|
||||||
*
|
*
|
||||||
@ -1312,7 +1377,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
$prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_GET);
|
$prefix = $this->getAttribute(Doctrine::ATTR_ACCESSOR_PREFIX_GET);
|
||||||
if (!$prefix)
|
if ( ! $prefix)
|
||||||
$prefix = 'get';
|
$prefix = 'get';
|
||||||
|
|
||||||
$method = $prefix . $name;
|
$method = $prefix . $name;
|
||||||
@ -1336,6 +1401,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getColumnCount
|
* getColumnCount
|
||||||
*
|
*
|
||||||
@ -1355,6 +1421,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return $this->columns;
|
return $this->columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an array containing all the column names
|
* returns an array containing all the column names
|
||||||
*
|
*
|
||||||
@ -1377,6 +1444,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTypeOf
|
* getTypeOf
|
||||||
*
|
*
|
||||||
@ -1389,6 +1457,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setData
|
* setData
|
||||||
* doctrine uses this function internally
|
* doctrine uses this function internally
|
||||||
@ -1401,6 +1470,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the maximum primary key value
|
* returns the maximum primary key value
|
||||||
*
|
*
|
||||||
@ -1413,6 +1483,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
$data = $stmt->fetch(PDO::FETCH_NUM);
|
$data = $stmt->fetch(PDO::FETCH_NUM);
|
||||||
return isset($data[0])?$data[0]:1;
|
return isset($data[0])?$data[0]:1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns internal data, used by Doctrine_Record instances
|
* returns internal data, used by Doctrine_Record instances
|
||||||
* when retrieving data from database
|
* when retrieving data from database
|
||||||
@ -1423,6 +1494,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getter for associated tree
|
* getter for associated tree
|
||||||
*
|
*
|
||||||
@ -1453,6 +1525,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
{
|
{
|
||||||
$this->options['tableName'] = $tableName;
|
$this->options['tableName'] = $tableName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* determine if table acts as tree
|
* determine if table acts as tree
|
||||||
*
|
*
|
||||||
@ -1461,6 +1534,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
|||||||
public function isTree() {
|
public function isTree() {
|
||||||
return ( ! is_null($this->options['treeImpl'])) ? true : false;
|
return ( ! is_null($this->options['treeImpl'])) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a string representation of this object
|
* returns a string representation of this object
|
||||||
*
|
*
|
||||||
|
@ -349,7 +349,7 @@ final class Doctrine
|
|||||||
* HYDRATION CONSTANTS
|
* HYDRATION CONSTANTS
|
||||||
*/
|
*/
|
||||||
const HYDRATE_RECORD = 2;
|
const HYDRATE_RECORD = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HYDRATE_ARRAY
|
* HYDRATE_ARRAY
|
||||||
*/
|
*/
|
||||||
@ -736,7 +736,7 @@ final class Doctrine
|
|||||||
*/
|
*/
|
||||||
public static function createDatabases($specifiedConnections = array())
|
public static function createDatabases($specifiedConnections = array())
|
||||||
{
|
{
|
||||||
if (!is_array($specifiedConnections)) {
|
if ( ! is_array($specifiedConnections)) {
|
||||||
$specifiedConnections = (array) $specifiedConnections;
|
$specifiedConnections = (array) $specifiedConnections;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -744,7 +744,7 @@ final class Doctrine
|
|||||||
$connections = $manager->getConnections();
|
$connections = $manager->getConnections();
|
||||||
|
|
||||||
foreach ($connections as $name => $connection) {
|
foreach ($connections as $name => $connection) {
|
||||||
if (!empty($specifiedConnections) && !in_array($name, $specifiedConnections)) {
|
if ( ! empty($specifiedConnections) && !in_array($name, $specifiedConnections)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -783,7 +783,7 @@ final class Doctrine
|
|||||||
*/
|
*/
|
||||||
public static function dropDatabases($specifiedConnections = array())
|
public static function dropDatabases($specifiedConnections = array())
|
||||||
{
|
{
|
||||||
if (!is_array($specifiedConnections)) {
|
if ( ! is_array($specifiedConnections)) {
|
||||||
$specifiedConnections = (array) $specifiedConnections;
|
$specifiedConnections = (array) $specifiedConnections;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,7 +792,7 @@ final class Doctrine
|
|||||||
$connections = $manager->getConnections();
|
$connections = $manager->getConnections();
|
||||||
|
|
||||||
foreach ($connections as $name => $connection) {
|
foreach ($connections as $name => $connection) {
|
||||||
if (!empty($specifiedConnections) && !in_array($name, $specifiedConnections)) {
|
if ( ! empty($specifiedConnections) && !in_array($name, $specifiedConnections)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -834,7 +834,7 @@ final class Doctrine
|
|||||||
{
|
{
|
||||||
$data = new Doctrine_Data();
|
$data = new Doctrine_Data();
|
||||||
|
|
||||||
if (!$append) {
|
if ( ! $append) {
|
||||||
$data->purge();
|
$data->purge();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -854,13 +854,13 @@ final class Doctrine
|
|||||||
{
|
{
|
||||||
$data = new Doctrine_Data();
|
$data = new Doctrine_Data();
|
||||||
|
|
||||||
if (!$append) {
|
if ( ! $append) {
|
||||||
$data->purge();
|
$data->purge();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data->importDummyData($num);
|
return $data->importDummyData($num);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* migrate
|
* migrate
|
||||||
*
|
*
|
||||||
@ -920,7 +920,7 @@ final class Doctrine
|
|||||||
|
|
||||||
return $builder->generateMigrationsFromModels($modelsPath);
|
return $builder->generateMigrationsFromModels($modelsPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTable
|
* getTable
|
||||||
*
|
*
|
||||||
@ -931,7 +931,7 @@ final class Doctrine
|
|||||||
{
|
{
|
||||||
return Doctrine_Manager::table($tableName);
|
return Doctrine_Manager::table($tableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* connection
|
* connection
|
||||||
*
|
*
|
||||||
@ -943,7 +943,7 @@ final class Doctrine
|
|||||||
{
|
{
|
||||||
return Doctrine_Manager::connection($adapter, $name);
|
return Doctrine_Manager::connection($adapter, $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fileFinder
|
* fileFinder
|
||||||
*
|
*
|
||||||
@ -954,7 +954,7 @@ final class Doctrine
|
|||||||
{
|
{
|
||||||
return Doctrine_FileFinder::type($type);
|
return Doctrine_FileFinder::type($type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* compile
|
* compile
|
||||||
* method for making a single file of most used doctrine runtime components
|
* method for making a single file of most used doctrine runtime components
|
||||||
@ -970,7 +970,7 @@ final class Doctrine
|
|||||||
{
|
{
|
||||||
return Doctrine_Compiler::compile($target, $includedDrivers);
|
return Doctrine_Compiler::compile($target, $includedDrivers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* simple autoload function
|
* simple autoload function
|
||||||
* returns true if the class was loaded, otherwise false
|
* returns true if the class was loaded, otherwise false
|
||||||
@ -998,7 +998,7 @@ final class Doctrine
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dump
|
* dump
|
||||||
*
|
*
|
||||||
@ -1030,7 +1030,7 @@ final class Doctrine
|
|||||||
}
|
}
|
||||||
return implode("\n", $ret);
|
return implode("\n", $ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns table name from class name
|
* returns table name from class name
|
||||||
*
|
*
|
||||||
@ -1041,7 +1041,7 @@ final class Doctrine
|
|||||||
{
|
{
|
||||||
return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $classname));
|
return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $classname));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns class name from table name
|
* returns class name from table name
|
||||||
*
|
*
|
||||||
@ -1052,7 +1052,7 @@ final class Doctrine
|
|||||||
{
|
{
|
||||||
return preg_replace_callback('~(_?)(_)([\w])~', array("Doctrine", "classifyCallback"), ucfirst($tablename));
|
return preg_replace_callback('~(_?)(_)([\w])~', array("Doctrine", "classifyCallback"), ucfirst($tablename));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function to classify a classname propperly.
|
* Callback function to classify a classname propperly.
|
||||||
*
|
*
|
||||||
@ -1063,7 +1063,7 @@ final class Doctrine
|
|||||||
{
|
{
|
||||||
return $matches[1] . strtoupper($matches[3]);
|
return $matches[1] . strtoupper($matches[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* checks for valid class name (uses camel case and underscores)
|
* checks for valid class name (uses camel case and underscores)
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Access
|
* Doctrine_Access
|
||||||
*
|
*
|
||||||
@ -49,6 +50,7 @@ abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements Ar
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __set an alias of set()
|
* __set an alias of set()
|
||||||
*
|
*
|
||||||
@ -62,6 +64,7 @@ abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements Ar
|
|||||||
{
|
{
|
||||||
$this->set($name,$value);
|
$this->set($name,$value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __get -- an alias of get()
|
* __get -- an alias of get()
|
||||||
*
|
*
|
||||||
@ -74,6 +77,7 @@ abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements Ar
|
|||||||
{
|
{
|
||||||
return $this->get($name);
|
return $this->get($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __isset()
|
* __isset()
|
||||||
*
|
*
|
||||||
@ -85,6 +89,7 @@ abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements Ar
|
|||||||
{
|
{
|
||||||
return $this->contains($name);
|
return $this->contains($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __unset()
|
* __unset()
|
||||||
*
|
*
|
||||||
@ -96,6 +101,7 @@ abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements Ar
|
|||||||
{
|
{
|
||||||
return $this->remove($name);
|
return $this->remove($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $offset
|
* @param mixed $offset
|
||||||
* @return boolean whether or not this object contains $offset
|
* @return boolean whether or not this object contains $offset
|
||||||
@ -104,6 +110,7 @@ abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements Ar
|
|||||||
{
|
{
|
||||||
return $this->contains($offset);
|
return $this->contains($offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* offsetGet an alias of get()
|
* offsetGet an alias of get()
|
||||||
* @see get, __get
|
* @see get, __get
|
||||||
@ -114,6 +121,7 @@ abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements Ar
|
|||||||
{
|
{
|
||||||
return $this->get($offset);
|
return $this->get($offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sets $offset to $value
|
* sets $offset to $value
|
||||||
* @see set, __set
|
* @see set, __set
|
||||||
@ -129,6 +137,7 @@ abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements Ar
|
|||||||
$this->set($offset, $value);
|
$this->set($offset, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unset a given offset
|
* unset a given offset
|
||||||
* @see set, offsetSet, __set
|
* @see set, offsetSet, __set
|
||||||
|
@ -268,6 +268,7 @@ class Doctrine_Adapter_Db2 extends Doctrine_Adapter
|
|||||||
$identQuote = $info->IDENTIFIER_QUOTE_CHAR;
|
$identQuote = $info->IDENTIFIER_QUOTE_CHAR;
|
||||||
return $identQuote;
|
return $identQuote;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Begin a transaction.
|
* Begin a transaction.
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Adapter_Interface
|
* Doctrine_Adapter_Interface
|
||||||
* This adapter interface should be implemented by all custom adapters
|
* This adapter interface should be implemented by all custom adapters
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Adapter_Mock
|
* Doctrine_Adapter_Mock
|
||||||
* This class is used for special testing purposes.
|
* This class is used for special testing purposes.
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Adapter_Mysqli
|
* Doctrine_Adapter_Mysqli
|
||||||
* This class is used for special testing purposes.
|
* This class is used for special testing purposes.
|
||||||
|
@ -181,6 +181,7 @@ class Doctrine_Adapter_Oracle extends Doctrine_Adapter
|
|||||||
// Oracle doesn't allow the 'AS' keyword between the table identifier/expression and alias.
|
// Oracle doesn't allow the 'AS' keyword between the table identifier/expression and alias.
|
||||||
return $this->_quoteIdentifierAs($ident, $alias, ' ');
|
return $this->_quoteIdentifierAs($ident, $alias, ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Leave autocommit mode and begin a transaction.
|
* Leave autocommit mode and begin a transaction.
|
||||||
*
|
*
|
||||||
@ -190,6 +191,7 @@ class Doctrine_Adapter_Oracle extends Doctrine_Adapter
|
|||||||
{
|
{
|
||||||
$this->_setExecuteMode(OCI_DEFAULT);
|
$this->_setExecuteMode(OCI_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Commit a transaction and return to autocommit mode.
|
* Commit a transaction and return to autocommit mode.
|
||||||
*
|
*
|
||||||
@ -203,6 +205,7 @@ class Doctrine_Adapter_Oracle extends Doctrine_Adapter
|
|||||||
}
|
}
|
||||||
$this->_setExecuteMode(OCI_COMMIT_ON_SUCCESS);
|
$this->_setExecuteMode(OCI_COMMIT_ON_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Roll back a transaction and return to autocommit mode.
|
* Roll back a transaction and return to autocommit mode.
|
||||||
*
|
*
|
||||||
@ -240,6 +243,7 @@ class Doctrine_Adapter_Oracle extends Doctrine_Adapter
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param integer $mode
|
* @param integer $mode
|
||||||
* @throws Doctrine_Adapter_Exception
|
* @throws Doctrine_Adapter_Exception
|
||||||
@ -257,6 +261,7 @@ class Doctrine_Adapter_Oracle extends Doctrine_Adapter
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Adapter_Statement
|
* Doctrine_Adapter_Statement
|
||||||
*
|
*
|
||||||
@ -34,6 +35,7 @@ abstract class Doctrine_Adapter_Statement
|
|||||||
public function bindValue($no, $value)
|
public function bindValue($no, $value)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetch
|
* fetch
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Adapter_Statement
|
* Doctrine_Adapter_Statement
|
||||||
*
|
*
|
||||||
@ -43,6 +44,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return boolean Returns TRUE on success or FALSE on failure
|
* @return boolean Returns TRUE on success or FALSE on failure
|
||||||
*/
|
*/
|
||||||
public function bindColumn($column, $param, $type = null);
|
public function bindColumn($column, $param, $type = null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bindValue
|
* bindValue
|
||||||
* Binds a value to a corresponding named or question mark
|
* Binds a value to a corresponding named or question mark
|
||||||
@ -58,6 +60,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return boolean Returns TRUE on success or FALSE on failure.
|
* @return boolean Returns TRUE on success or FALSE on failure.
|
||||||
*/
|
*/
|
||||||
public function bindValue($param, $value, $type = null);
|
public function bindValue($param, $value, $type = null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bindParam
|
* bindParam
|
||||||
* Binds a PHP variable to a corresponding named or question mark placeholder in the
|
* Binds a PHP variable to a corresponding named or question mark placeholder in the
|
||||||
@ -86,6 +89,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return boolean Returns TRUE on success or FALSE on failure.
|
* @return boolean Returns TRUE on success or FALSE on failure.
|
||||||
*/
|
*/
|
||||||
public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array());
|
public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* closeCursor
|
* closeCursor
|
||||||
* Closes the cursor, enabling the statement to be executed again.
|
* Closes the cursor, enabling the statement to be executed again.
|
||||||
@ -93,6 +97,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return boolean Returns TRUE on success or FALSE on failure.
|
* @return boolean Returns TRUE on success or FALSE on failure.
|
||||||
*/
|
*/
|
||||||
public function closeCursor();
|
public function closeCursor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* columnCount
|
* columnCount
|
||||||
* Returns the number of columns in the result set
|
* Returns the number of columns in the result set
|
||||||
@ -102,6 +107,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* this method should return 0.
|
* this method should return 0.
|
||||||
*/
|
*/
|
||||||
public function columnCount();
|
public function columnCount();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* errorCode
|
* errorCode
|
||||||
* Fetch the SQLSTATE associated with the last operation on the statement handle
|
* Fetch the SQLSTATE associated with the last operation on the statement handle
|
||||||
@ -110,6 +116,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return string error code string
|
* @return string error code string
|
||||||
*/
|
*/
|
||||||
public function errorCode();
|
public function errorCode();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* errorInfo
|
* errorInfo
|
||||||
* Fetch extended error information associated with the last operation on the statement handle
|
* Fetch extended error information associated with the last operation on the statement handle
|
||||||
@ -118,6 +125,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return array error info array
|
* @return array error info array
|
||||||
*/
|
*/
|
||||||
public function errorInfo();
|
public function errorInfo();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute
|
* execute
|
||||||
* Executes a prepared statement
|
* Executes a prepared statement
|
||||||
@ -134,6 +142,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return boolean Returns TRUE on success or FALSE on failure.
|
* @return boolean Returns TRUE on success or FALSE on failure.
|
||||||
*/
|
*/
|
||||||
public function execute($params = null);
|
public function execute($params = null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetch
|
* fetch
|
||||||
*
|
*
|
||||||
@ -164,6 +173,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
public function fetch($fetchStyle = Doctrine::FETCH_BOTH,
|
public function fetch($fetchStyle = Doctrine::FETCH_BOTH,
|
||||||
$cursorOrientation = Doctrine::FETCH_ORI_NEXT,
|
$cursorOrientation = Doctrine::FETCH_ORI_NEXT,
|
||||||
$cursorOffset = null);
|
$cursorOffset = null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchAll
|
* fetchAll
|
||||||
* Returns an array containing all of the result set rows
|
* Returns an array containing all of the result set rows
|
||||||
@ -178,6 +188,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function fetchAll($fetchStyle = Doctrine::FETCH_BOTH);
|
public function fetchAll($fetchStyle = Doctrine::FETCH_BOTH);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchColumn
|
* fetchColumn
|
||||||
* Returns a single column from the next row of a
|
* Returns a single column from the next row of a
|
||||||
@ -190,6 +201,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return string returns a single column in the next row of a result set.
|
* @return string returns a single column in the next row of a result set.
|
||||||
*/
|
*/
|
||||||
public function fetchColumn($columnIndex = 0);
|
public function fetchColumn($columnIndex = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchObject
|
* fetchObject
|
||||||
* Fetches the next row and returns it as an object.
|
* Fetches the next row and returns it as an object.
|
||||||
@ -204,6 +216,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* to the column names or FALSE in case of an error.
|
* to the column names or FALSE in case of an error.
|
||||||
*/
|
*/
|
||||||
public function fetchObject($className = 'stdClass', $args = array());
|
public function fetchObject($className = 'stdClass', $args = array());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAttribute
|
* getAttribute
|
||||||
* Retrieve a statement attribute
|
* Retrieve a statement attribute
|
||||||
@ -213,6 +226,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return mixed the attribute value
|
* @return mixed the attribute value
|
||||||
*/
|
*/
|
||||||
public function getAttribute($attribute);
|
public function getAttribute($attribute);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getColumnMeta
|
* getColumnMeta
|
||||||
* Returns metadata for a column in a result set
|
* Returns metadata for a column in a result set
|
||||||
@ -230,6 +244,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* pdo_type The type of this column as represented by the PDO::PARAM_* constants.
|
* pdo_type The type of this column as represented by the PDO::PARAM_* constants.
|
||||||
*/
|
*/
|
||||||
public function getColumnMeta($column);
|
public function getColumnMeta($column);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nextRowset
|
* nextRowset
|
||||||
* Advances to the next rowset in a multi-rowset statement handle
|
* Advances to the next rowset in a multi-rowset statement handle
|
||||||
@ -242,6 +257,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return boolean Returns TRUE on success or FALSE on failure.
|
* @return boolean Returns TRUE on success or FALSE on failure.
|
||||||
*/
|
*/
|
||||||
public function nextRowset();
|
public function nextRowset();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rowCount
|
* rowCount
|
||||||
* rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
|
* rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
|
||||||
@ -255,6 +271,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return integer Returns the number of rows.
|
* @return integer Returns the number of rows.
|
||||||
*/
|
*/
|
||||||
public function rowCount();
|
public function rowCount();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setAttribute
|
* setAttribute
|
||||||
* Set a statement attribute
|
* Set a statement attribute
|
||||||
@ -264,6 +281,7 @@ interface Doctrine_Adapter_Statement_Interface
|
|||||||
* @return boolean Returns TRUE on success or FALSE on failure.
|
* @return boolean Returns TRUE on success or FALSE on failure.
|
||||||
*/
|
*/
|
||||||
public function setAttribute($attribute, $value);
|
public function setAttribute($attribute, $value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setFetchMode
|
* setFetchMode
|
||||||
* Set the default fetch mode for this statement
|
* Set the default fetch mode for this statement
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Adapter_Statement_Mock
|
* Doctrine_Adapter_Statement_Mock
|
||||||
* This class is used for special testing purposes.
|
* This class is used for special testing purposes.
|
||||||
@ -40,6 +41,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
$this->mock = $mock;
|
$this->mock = $mock;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bindColumn
|
* bindColumn
|
||||||
* Bind a column to a PHP variable
|
* Bind a column to a PHP variable
|
||||||
@ -55,6 +57,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bindValue
|
* bindValue
|
||||||
* Binds a value to a corresponding named or question mark
|
* Binds a value to a corresponding named or question mark
|
||||||
@ -73,6 +76,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bindParam
|
* bindParam
|
||||||
* Binds a PHP variable to a corresponding named or question mark placeholder in the
|
* Binds a PHP variable to a corresponding named or question mark placeholder in the
|
||||||
@ -104,6 +108,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* closeCursor
|
* closeCursor
|
||||||
* Closes the cursor, enabling the statement to be executed again.
|
* Closes the cursor, enabling the statement to be executed again.
|
||||||
@ -114,6 +119,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* columnCount
|
* columnCount
|
||||||
* Returns the number of columns in the result set
|
* Returns the number of columns in the result set
|
||||||
@ -126,6 +132,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* errorCode
|
* errorCode
|
||||||
* Fetch the SQLSTATE associated with the last operation on the statement handle
|
* Fetch the SQLSTATE associated with the last operation on the statement handle
|
||||||
@ -137,6 +144,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* errorInfo
|
* errorInfo
|
||||||
* Fetch extended error information associated with the last operation on the statement handle
|
* Fetch extended error information associated with the last operation on the statement handle
|
||||||
@ -148,6 +156,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetch
|
* fetch
|
||||||
*
|
*
|
||||||
@ -181,6 +190,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchAll
|
* fetchAll
|
||||||
* Returns an array containing all of the result set rows
|
* Returns an array containing all of the result set rows
|
||||||
@ -198,6 +208,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute
|
* execute
|
||||||
* Executes a prepared statement
|
* Executes a prepared statement
|
||||||
@ -220,6 +231,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchColumn
|
* fetchColumn
|
||||||
* Returns a single column from the next row of a
|
* Returns a single column from the next row of a
|
||||||
@ -235,6 +247,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchObject
|
* fetchObject
|
||||||
* Fetches the next row and returns it as an object.
|
* Fetches the next row and returns it as an object.
|
||||||
@ -252,6 +265,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
return new $className();
|
return new $className();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nextRowset
|
* nextRowset
|
||||||
* Advances to the next rowset in a multi-rowset statement handle
|
* Advances to the next rowset in a multi-rowset statement handle
|
||||||
@ -267,6 +281,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rowCount
|
* rowCount
|
||||||
* rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
|
* rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
|
||||||
@ -283,6 +298,7 @@ class Doctrine_Adapter_Statement_Mock implements Doctrine_Adapter_Statement_Inte
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getColumnMeta
|
* getColumnMeta
|
||||||
* Returns metadata for a column in a result set
|
* Returns metadata for a column in a result set
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_AuditLog
|
* Doctrine_AuditLog
|
||||||
*
|
*
|
||||||
|
@ -42,22 +42,27 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
'cleanPropability' => 0.01,
|
'cleanPropability' => 0.01,
|
||||||
'statsFile' => '../data/stats.cache',
|
'statsFile' => '../data/stats.cache',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $_queries query stack
|
* @var array $_queries query stack
|
||||||
*/
|
*/
|
||||||
protected $_queries = array();
|
protected $_queries = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Cache_Interface $_driver the cache driver object
|
* @var Doctrine_Cache_Interface $_driver the cache driver object
|
||||||
*/
|
*/
|
||||||
protected $_driver;
|
protected $_driver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $data current cache data array
|
* @var array $data current cache data array
|
||||||
*/
|
*/
|
||||||
protected $_data = array();
|
protected $_data = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $success the success of last operation
|
* @var boolean $success the success of last operation
|
||||||
*/
|
*/
|
||||||
protected $_success = false;
|
protected $_success = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*
|
*
|
||||||
@ -83,6 +88,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
$this->_driver = new $class($options);
|
$this->_driver = new $class($options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDriver
|
* getDriver
|
||||||
* returns the current cache driver
|
* returns the current cache driver
|
||||||
@ -93,6 +99,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
{
|
{
|
||||||
return $this->_driver;
|
return $this->_driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setOption
|
* setOption
|
||||||
*
|
*
|
||||||
@ -113,6 +120,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getOption
|
* getOption
|
||||||
*
|
*
|
||||||
@ -127,6 +135,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
|
|
||||||
return $this->_options[$option];
|
return $this->_options[$option];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add
|
* add
|
||||||
* adds a query to internal query stack
|
* adds a query to internal query stack
|
||||||
@ -143,6 +152,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
$this->_queries[] = $query;
|
$this->_queries[] = $query;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getQueries
|
* getQueries
|
||||||
*
|
*
|
||||||
@ -161,6 +171,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
|
|
||||||
return $this->_queries;
|
return $this->_queries;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pop
|
* pop
|
||||||
*
|
*
|
||||||
@ -171,6 +182,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
{
|
{
|
||||||
return array_pop($this->_queries);
|
return array_pop($this->_queries);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reset
|
* reset
|
||||||
*
|
*
|
||||||
@ -181,6 +193,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
{
|
{
|
||||||
$this->_queries = array();
|
$this->_queries = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count
|
* count
|
||||||
*
|
*
|
||||||
@ -190,6 +203,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
{
|
{
|
||||||
return count($this->_queries);
|
return count($this->_queries);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getIterator
|
* getIterator
|
||||||
*
|
*
|
||||||
@ -199,6 +213,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
{
|
{
|
||||||
return new ArrayIterator($this->_queries);
|
return new ArrayIterator($this->_queries);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return boolean whether or not the last cache operation was successful
|
* @return boolean whether or not the last cache operation was successful
|
||||||
*/
|
*/
|
||||||
@ -206,6 +221,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
{
|
{
|
||||||
return $this->_success;
|
return $this->_success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* save
|
* save
|
||||||
*
|
*
|
||||||
@ -241,6 +257,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* readStats
|
* readStats
|
||||||
*
|
*
|
||||||
@ -257,6 +274,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
}
|
}
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* appendStats
|
* appendStats
|
||||||
*
|
*
|
||||||
@ -278,6 +296,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* preQuery
|
* preQuery
|
||||||
* listens on the Doctrine_Event preQuery event
|
* listens on the Doctrine_Event preQuery event
|
||||||
@ -322,6 +341,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* preFetch
|
* preFetch
|
||||||
* listens the preFetch event of Doctrine_Connection_Statement
|
* listens the preFetch event of Doctrine_Connection_Statement
|
||||||
@ -337,6 +357,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
next($this->_data);
|
next($this->_data);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* preFetch
|
* preFetch
|
||||||
* listens the preFetchAll event of Doctrine_Connection_Statement
|
* listens the preFetchAll event of Doctrine_Connection_Statement
|
||||||
@ -349,6 +370,7 @@ class Doctrine_Cache extends Doctrine_EventListener implements Countable, Iterat
|
|||||||
{
|
{
|
||||||
return $this->_data;
|
return $this->_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* preExecute
|
* preExecute
|
||||||
* listens the preExecute event of Doctrine_Connection_Statement
|
* listens the preExecute event of Doctrine_Connection_Statement
|
||||||
|
@ -44,6 +44,7 @@ class Doctrine_Cache_Apc extends Doctrine_Cache_Driver
|
|||||||
}
|
}
|
||||||
parent::__construct($options);
|
parent::__construct($options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if a cache is available for the given id and (if yes) return it (false else)
|
* Test if a cache is available for the given id and (if yes) return it (false else)
|
||||||
*
|
*
|
||||||
@ -61,6 +62,7 @@ class Doctrine_Cache_Apc extends Doctrine_Cache_Driver
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if a cache is available or not (for the given id)
|
* Test if a cache is available or not (for the given id)
|
||||||
*
|
*
|
||||||
@ -75,6 +77,7 @@ class Doctrine_Cache_Apc extends Doctrine_Cache_Driver
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save some string datas into a cache record
|
* Save some string datas into a cache record
|
||||||
*
|
*
|
||||||
@ -91,6 +94,7 @@ class Doctrine_Cache_Apc extends Doctrine_Cache_Driver
|
|||||||
|
|
||||||
return (bool) apc_store($id, array($data, time()), $lifeTime);
|
return (bool) apc_store($id, array($data, time()), $lifeTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a cache record
|
* Remove a cache record
|
||||||
*
|
*
|
||||||
|
@ -53,6 +53,7 @@ class Doctrine_Cache_Array implements Countable, Doctrine_Cache_Interface
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if a cache is available or not (for the given id)
|
* Test if a cache is available or not (for the given id)
|
||||||
*
|
*
|
||||||
@ -63,6 +64,7 @@ class Doctrine_Cache_Array implements Countable, Doctrine_Cache_Interface
|
|||||||
{
|
{
|
||||||
return isset($this->data[$id]);
|
return isset($this->data[$id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save some string datas into a cache record
|
* Save some string datas into a cache record
|
||||||
*
|
*
|
||||||
@ -77,6 +79,7 @@ class Doctrine_Cache_Array implements Countable, Doctrine_Cache_Interface
|
|||||||
{
|
{
|
||||||
$this->data[$id] = $data;
|
$this->data[$id] = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a cache record
|
* Remove a cache record
|
||||||
*
|
*
|
||||||
@ -87,6 +90,7 @@ class Doctrine_Cache_Array implements Countable, Doctrine_Cache_Interface
|
|||||||
{
|
{
|
||||||
unset($this->data[$id]);
|
unset($this->data[$id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all cache record
|
* Remove all cache record
|
||||||
*
|
*
|
||||||
@ -96,6 +100,7 @@ class Doctrine_Cache_Array implements Countable, Doctrine_Cache_Interface
|
|||||||
{
|
{
|
||||||
$this->data = array();
|
$this->data = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count
|
* count
|
||||||
*
|
*
|
||||||
|
@ -54,6 +54,7 @@ class Doctrine_Cache_Db extends Doctrine_Cache_Driver implements Countable
|
|||||||
|
|
||||||
$this->_options = $options;
|
$this->_options = $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getConnection
|
* getConnection
|
||||||
* returns the connection object associated with this cache driver
|
* returns the connection object associated with this cache driver
|
||||||
@ -64,6 +65,7 @@ class Doctrine_Cache_Db extends Doctrine_Cache_Driver implements Countable
|
|||||||
{
|
{
|
||||||
return $this->_options['connection'];
|
return $this->_options['connection'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if a cache is available for the given id and (if yes) return it (false else)
|
* Test if a cache is available for the given id and (if yes) return it (false else)
|
||||||
*
|
*
|
||||||
@ -90,6 +92,7 @@ class Doctrine_Cache_Db extends Doctrine_Cache_Driver implements Countable
|
|||||||
|
|
||||||
return unserialize($result[0]['data']);
|
return unserialize($result[0]['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if a cache is available or not (for the given id)
|
* Test if a cache is available or not (for the given id)
|
||||||
*
|
*
|
||||||
@ -103,6 +106,7 @@ class Doctrine_Cache_Db extends Doctrine_Cache_Driver implements Countable
|
|||||||
|
|
||||||
return $this->getConnection()->fetchOne($sql, array($id));
|
return $this->getConnection()->fetchOne($sql, array($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save some string datas into a cache record
|
* Save some string datas into a cache record
|
||||||
*
|
*
|
||||||
@ -128,6 +132,7 @@ class Doctrine_Cache_Db extends Doctrine_Cache_Driver implements Countable
|
|||||||
|
|
||||||
return (bool) $this->getConnection()->exec($sql, $params);
|
return (bool) $this->getConnection()->exec($sql, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a cache record
|
* Remove a cache record
|
||||||
*
|
*
|
||||||
@ -140,7 +145,7 @@ class Doctrine_Cache_Db extends Doctrine_Cache_Driver implements Countable
|
|||||||
|
|
||||||
return (bool) $this->getConnection()->exec($sql, array($id));
|
return (bool) $this->getConnection()->exec($sql, array($id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes all cache records
|
* Removes all cache records
|
||||||
*
|
*
|
||||||
@ -152,7 +157,7 @@ class Doctrine_Cache_Db extends Doctrine_Cache_Driver implements Countable
|
|||||||
|
|
||||||
return (bool) $this->getConnection()->exec($sql);
|
return (bool) $this->getConnection()->exec($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count
|
* count
|
||||||
* returns the number of cached elements
|
* returns the number of cached elements
|
||||||
@ -165,7 +170,7 @@ class Doctrine_Cache_Db extends Doctrine_Cache_Driver implements Countable
|
|||||||
|
|
||||||
return (int) $this->getConnection()->fetchOne($sql);
|
return (int) $this->getConnection()->fetchOne($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the cache table.
|
* Creates the cache table.
|
||||||
*/
|
*/
|
||||||
|
@ -36,7 +36,7 @@ abstract class Doctrine_Cache_Driver implements Doctrine_Cache_Interface
|
|||||||
* @var array $_options an array of options
|
* @var array $_options an array of options
|
||||||
*/
|
*/
|
||||||
protected $_options = array();
|
protected $_options = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*
|
*
|
||||||
@ -46,6 +46,7 @@ abstract class Doctrine_Cache_Driver implements Doctrine_Cache_Interface
|
|||||||
{
|
{
|
||||||
$this->_options = $options;
|
$this->_options = $options;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setOption
|
* setOption
|
||||||
*
|
*
|
||||||
@ -61,6 +62,7 @@ abstract class Doctrine_Cache_Driver implements Doctrine_Cache_Interface
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getOption
|
* getOption
|
||||||
*
|
*
|
||||||
|
@ -36,6 +36,7 @@ class Doctrine_Cache_Memcache extends Doctrine_Cache_Driver
|
|||||||
* @var Memcache $_memcache memcache object
|
* @var Memcache $_memcache memcache object
|
||||||
*/
|
*/
|
||||||
protected $_memcache = null;
|
protected $_memcache = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*
|
*
|
||||||
@ -69,6 +70,7 @@ class Doctrine_Cache_Memcache extends Doctrine_Cache_Driver
|
|||||||
$this->_memcache->addServer($server['host'], $server['port'], $server['persistent']);
|
$this->_memcache->addServer($server['host'], $server['port'], $server['persistent']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if a cache is available for the given id and (if yes) return it (false else)
|
* Test if a cache is available for the given id and (if yes) return it (false else)
|
||||||
*
|
*
|
||||||
@ -88,6 +90,7 @@ class Doctrine_Cache_Memcache extends Doctrine_Cache_Driver
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if a cache is available or not (for the given id)
|
* Test if a cache is available or not (for the given id)
|
||||||
*
|
*
|
||||||
@ -98,6 +101,7 @@ class Doctrine_Cache_Memcache extends Doctrine_Cache_Driver
|
|||||||
{
|
{
|
||||||
return (bool) $this->_memcache->get($id);
|
return (bool) $this->_memcache->get($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save some string datas into a cache record
|
* Save some string datas into a cache record
|
||||||
*
|
*
|
||||||
@ -118,6 +122,7 @@ class Doctrine_Cache_Memcache extends Doctrine_Cache_Driver
|
|||||||
|
|
||||||
$result = $this->_memcache->set($id, $data, $flag, $lifeTime);
|
$result = $this->_memcache->set($id, $data, $flag, $lifeTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a cache record
|
* Remove a cache record
|
||||||
*
|
*
|
||||||
|
@ -38,7 +38,7 @@ class Doctrine_Cli
|
|||||||
$scriptName = null,
|
$scriptName = null,
|
||||||
$message = null,
|
$message = null,
|
||||||
$config = array();
|
$config = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __construct
|
* __construct
|
||||||
*
|
*
|
||||||
@ -52,7 +52,7 @@ class Doctrine_Cli
|
|||||||
|
|
||||||
$this->loadTasks();
|
$this->loadTasks();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notify
|
* notify
|
||||||
*
|
*
|
||||||
@ -63,7 +63,7 @@ class Doctrine_Cli
|
|||||||
{
|
{
|
||||||
echo $this->formatter->format($this->taskInstance->getTaskName(), 'INFO') . ' - ' . $this->formatter->format($notification, $style) . "\n";
|
echo $this->formatter->format($this->taskInstance->getTaskName(), 'INFO') . ' - ' . $this->formatter->format($notification, $style) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notifyException
|
* notifyException
|
||||||
*
|
*
|
||||||
@ -109,7 +109,7 @@ class Doctrine_Cli
|
|||||||
|
|
||||||
$arg1 = isset($args[1]) ? $args[1]:null;
|
$arg1 = isset($args[1]) ? $args[1]:null;
|
||||||
|
|
||||||
if (!$arg1 || $arg1 == 'help') {
|
if ( ! $arg1 || $arg1 == 'help') {
|
||||||
echo $this->printTasks(null, $arg1 == 'help' ? true:false);
|
echo $this->printTasks(null, $arg1 == 'help' ? true:false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ class Doctrine_Cli
|
|||||||
|
|
||||||
$taskClass = $this->_getTaskClassFromArgs($args);
|
$taskClass = $this->_getTaskClassFromArgs($args);
|
||||||
|
|
||||||
if (!class_exists($taskClass)) {
|
if ( ! class_exists($taskClass)) {
|
||||||
throw new Doctrine_Cli_Exception('Cli task could not be found: ' . $taskClass);
|
throw new Doctrine_Cli_Exception('Cli task could not be found: ' . $taskClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ class Doctrine_Cli
|
|||||||
// Now lets fill in the entered arguments to the prepared array
|
// Now lets fill in the entered arguments to the prepared array
|
||||||
$copy = $args;
|
$copy = $args;
|
||||||
foreach ($prepared as $key => $value) {
|
foreach ($prepared as $key => $value) {
|
||||||
if (!$value && !empty($copy)) {
|
if ( ! $value && !empty($copy)) {
|
||||||
$prepared[$key] = $copy[0];
|
$prepared[$key] = $copy[0];
|
||||||
unset($copy[0]);
|
unset($copy[0]);
|
||||||
$copy = array_values($copy);
|
$copy = array_values($copy);
|
||||||
@ -229,7 +229,7 @@ class Doctrine_Cli
|
|||||||
|
|
||||||
$requiredArguments = $taskInstance->getRequiredArgumentsDescriptions();
|
$requiredArguments = $taskInstance->getRequiredArgumentsDescriptions();
|
||||||
|
|
||||||
if (!empty($requiredArguments)) {
|
if ( ! empty($requiredArguments)) {
|
||||||
foreach ($requiredArguments as $name => $description) {
|
foreach ($requiredArguments as $name => $description) {
|
||||||
$args .= $this->formatter->format($name, "ERROR");
|
$args .= $this->formatter->format($name, "ERROR");
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ class Doctrine_Cli
|
|||||||
|
|
||||||
$optionalArguments = $taskInstance->getOptionalArgumentsDescriptions();
|
$optionalArguments = $taskInstance->getOptionalArgumentsDescriptions();
|
||||||
|
|
||||||
if (!empty($optionalArguments)) {
|
if ( ! empty($optionalArguments)) {
|
||||||
foreach ($optionalArguments as $name => $description) {
|
foreach ($optionalArguments as $name => $description) {
|
||||||
$args .= $name . ' - ' . $description."\n";
|
$args .= $name . ' - ' . $description."\n";
|
||||||
}
|
}
|
||||||
@ -259,7 +259,7 @@ class Doctrine_Cli
|
|||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loadTasks
|
* loadTasks
|
||||||
*
|
*
|
||||||
@ -286,7 +286,7 @@ class Doctrine_Cli
|
|||||||
|
|
||||||
$className = 'Doctrine_Task_' . $e[0];
|
$className = 'Doctrine_Task_' . $e[0];
|
||||||
|
|
||||||
if (!class_exists($className)) {
|
if ( ! class_exists($className)) {
|
||||||
require_once($file->getPathName());
|
require_once($file->getPathName());
|
||||||
|
|
||||||
$class = new ReflectionClass($className);
|
$class = new ReflectionClass($className);
|
||||||
|
@ -69,17 +69,17 @@ class Doctrine_Cli_AnsiColorFormatter extends Doctrine_Cli_Formatter
|
|||||||
*/
|
*/
|
||||||
public function format($text = '', $parameters = array(), $stream = STDOUT)
|
public function format($text = '', $parameters = array(), $stream = STDOUT)
|
||||||
{
|
{
|
||||||
if (!$this->supportsColors($stream))
|
if ( ! $this->supportsColors($stream))
|
||||||
{
|
{
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_array($parameters) && 'NONE' == $parameters)
|
if ( ! is_array($parameters) && 'NONE' == $parameters)
|
||||||
{
|
{
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_array($parameters) && isset($this->styles[$parameters]))
|
if ( ! is_array($parameters) && isset($this->styles[$parameters]))
|
||||||
{
|
{
|
||||||
$parameters = $this->styles[$parameters];
|
$parameters = $this->styles[$parameters];
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ class Doctrine_Cli_AnsiColorFormatter extends Doctrine_Cli_Formatter
|
|||||||
*/
|
*/
|
||||||
public function excerpt($text, $size = null)
|
public function excerpt($text, $size = null)
|
||||||
{
|
{
|
||||||
if (!$size)
|
if ( ! $size)
|
||||||
{
|
{
|
||||||
$size = $this->size;
|
$size = $this->size;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ class Doctrine_Cli_Formatter
|
|||||||
*/
|
*/
|
||||||
public function excerpt($text, $size = null)
|
public function excerpt($text, $size = null)
|
||||||
{
|
{
|
||||||
if (!$size)
|
if ( ! $size)
|
||||||
{
|
{
|
||||||
$size = $this->size;
|
$size = $this->size;
|
||||||
}
|
}
|
||||||
|
@ -37,30 +37,37 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
* @var array $data an array containing the records of this collection
|
* @var array $data an array containing the records of this collection
|
||||||
*/
|
*/
|
||||||
protected $data = array();
|
protected $data = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Table $table each collection has only records of specified table
|
* @var Doctrine_Table $table each collection has only records of specified table
|
||||||
*/
|
*/
|
||||||
protected $_table;
|
protected $_table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $_snapshot a snapshot of the fetched data
|
* @var array $_snapshot a snapshot of the fetched data
|
||||||
*/
|
*/
|
||||||
protected $_snapshot = array();
|
protected $_snapshot = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Record $reference collection can belong to a record
|
* @var Doctrine_Record $reference collection can belong to a record
|
||||||
*/
|
*/
|
||||||
protected $reference;
|
protected $reference;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $referenceField the reference field of the collection
|
* @var string $referenceField the reference field of the collection
|
||||||
*/
|
*/
|
||||||
protected $referenceField;
|
protected $referenceField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Relation the record this collection is related to, if any
|
* @var Doctrine_Relation the record this collection is related to, if any
|
||||||
*/
|
*/
|
||||||
protected $relation;
|
protected $relation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $keyColumn the name of the column that is used for collection key mapping
|
* @var string $keyColumn the name of the column that is used for collection key mapping
|
||||||
*/
|
*/
|
||||||
protected $keyColumn;
|
protected $keyColumn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Null $null used for extremely fast null value testing
|
* @var Doctrine_Null $null used for extremely fast null value testing
|
||||||
*/
|
*/
|
||||||
@ -88,6 +95,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
$this->keyColumn = $keyColumn;
|
$this->keyColumn = $keyColumn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initNullObject
|
* initNullObject
|
||||||
* initializes the null object for this collection
|
* initializes the null object for this collection
|
||||||
@ -98,6 +106,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
self::$null = $null;
|
self::$null = $null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getTable
|
* getTable
|
||||||
* returns the table this collection belongs to
|
* returns the table this collection belongs to
|
||||||
@ -108,6 +117,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return $this->_table;
|
return $this->_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setData
|
* setData
|
||||||
*
|
*
|
||||||
@ -118,6 +128,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this method is automatically called when this Doctrine_Collection is serialized
|
* this method is automatically called when this Doctrine_Collection is serialized
|
||||||
*
|
*
|
||||||
@ -138,6 +149,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
return serialize($vars);
|
return serialize($vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unseralize
|
* unseralize
|
||||||
* this method is automatically called everytime a Doctrine_Collection object is unserialized
|
* this method is automatically called everytime a Doctrine_Collection object is unserialized
|
||||||
@ -165,6 +177,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
$this->keyColumn = $keyColumn;
|
$this->keyColumn = $keyColumn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setKeyColumn
|
* setKeyColumn
|
||||||
* sets the key column for this collection
|
* sets the key column for this collection
|
||||||
@ -178,6 +191,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getKeyColumn
|
* getKeyColumn
|
||||||
* returns the name of the key column
|
* returns the name of the key column
|
||||||
@ -188,6 +202,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return $this->column;
|
return $this->column;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getData
|
* getData
|
||||||
* returns all the records as an array
|
* returns all the records as an array
|
||||||
@ -198,6 +213,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getFirst
|
* getFirst
|
||||||
* returns the first record in the collection
|
* returns the first record in the collection
|
||||||
@ -208,6 +224,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return reset($this->data);
|
return reset($this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getLast
|
* getLast
|
||||||
* returns the last record in the collection
|
* returns the last record in the collection
|
||||||
@ -218,6 +235,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return end($this->data);
|
return end($this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setReference
|
* setReference
|
||||||
* sets a reference pointer
|
* sets a reference pointer
|
||||||
@ -247,6 +265,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getReference
|
* getReference
|
||||||
*
|
*
|
||||||
@ -256,6 +275,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return $this->reference;
|
return $this->reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* remove
|
* remove
|
||||||
* removes a specified collection element
|
* removes a specified collection element
|
||||||
@ -270,6 +290,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
unset($this->data[$key]);
|
unset($this->data[$key]);
|
||||||
return $removed;
|
return $removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* contains
|
* contains
|
||||||
* whether or not this collection contains a specified element
|
* whether or not this collection contains a specified element
|
||||||
@ -285,6 +306,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return array_search($record, $this->data, true);
|
return array_search($record, $this->data, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get
|
* get
|
||||||
* returns a record for given key
|
* returns a record for given key
|
||||||
@ -350,6 +372,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
}
|
}
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns all keys
|
* returns all keys
|
||||||
* @return array
|
* @return array
|
||||||
@ -358,6 +381,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return array_keys($this->data);
|
return array_keys($this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count
|
* count
|
||||||
* this class implements interface countable
|
* this class implements interface countable
|
||||||
@ -369,6 +393,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return count($this->data);
|
return count($this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set
|
* set
|
||||||
* @param integer $key
|
* @param integer $key
|
||||||
@ -383,6 +408,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
$this->data[$key] = $record;
|
$this->data[$key] = $record;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* adds a record to collection
|
* adds a record to collection
|
||||||
* @param Doctrine_Record $record record to be added
|
* @param Doctrine_Record $record record to be added
|
||||||
@ -430,6 +456,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loadRelated
|
* loadRelated
|
||||||
*
|
*
|
||||||
@ -475,6 +502,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
$this->populateRelated($name, $coll);
|
$this->populateRelated($name, $coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* populateRelated
|
* populateRelated
|
||||||
*
|
*
|
||||||
@ -533,6 +561,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getNormalIterator
|
* getNormalIterator
|
||||||
* returns normal iterator - an iterator that will not expand this collection
|
* returns normal iterator - an iterator that will not expand this collection
|
||||||
@ -543,6 +572,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return new Doctrine_Collection_Iterator_Normal($this);
|
return new Doctrine_Collection_Iterator_Normal($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* takeSnapshot
|
* takeSnapshot
|
||||||
* takes a snapshot from this collection
|
* takes a snapshot from this collection
|
||||||
@ -562,6 +592,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getSnapshot
|
* getSnapshot
|
||||||
* returns the data of the last snapshot
|
* returns the data of the last snapshot
|
||||||
@ -572,6 +603,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return $this->_snapshot;
|
return $this->_snapshot;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* processDiff
|
* processDiff
|
||||||
* processes the difference of the last snapshot and the current data
|
* processes the difference of the last snapshot and the current data
|
||||||
@ -592,6 +624,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* toArray
|
* toArray
|
||||||
* Mimics the result of a $query->execute(array(), Doctrine::FETCH_ARRAY);
|
* Mimics the result of a $query->execute(array(), Doctrine::FETCH_ARRAY);
|
||||||
@ -646,6 +679,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return array_udiff($this->data, $this->_snapshot, array($this, "compareRecords"));
|
return array_udiff($this->data, $this->_snapshot, array($this, "compareRecords"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* compareRecords
|
* compareRecords
|
||||||
* Compares two records. To be used on _snapshot diffs using array_udiff
|
* Compares two records. To be used on _snapshot diffs using array_udiff
|
||||||
@ -655,6 +689,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
if ($a->getOid() == $b->getOid()) return 0;
|
if ($a->getOid() == $b->getOid()) return 0;
|
||||||
return ($a->getOid() > $b->getOid()) ? 1 : -1;
|
return ($a->getOid() > $b->getOid()) ? 1 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* save
|
* save
|
||||||
* saves all records of this collection and processes the
|
* saves all records of this collection and processes the
|
||||||
@ -682,6 +717,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* delete
|
* delete
|
||||||
* single shot delete
|
* single shot delete
|
||||||
@ -709,6 +745,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getIterator
|
* getIterator
|
||||||
* @return object ArrayIterator
|
* @return object ArrayIterator
|
||||||
@ -718,6 +755,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
$data = $this->data;
|
$data = $this->data;
|
||||||
return new ArrayIterator($data);
|
return new ArrayIterator($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a string representation of this object
|
* returns a string representation of this object
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Collection_Exception
|
* Doctrine_Collection_Exception
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Collection_Iterator
|
* Doctrine_Collection_Iterator
|
||||||
* iterates through Doctrine_Collection
|
* iterates through Doctrine_Collection
|
||||||
@ -36,18 +37,22 @@ abstract class Doctrine_Collection_Iterator implements Iterator
|
|||||||
* @var Doctrine_Collection $collection
|
* @var Doctrine_Collection $collection
|
||||||
*/
|
*/
|
||||||
protected $collection;
|
protected $collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $keys
|
* @var array $keys
|
||||||
*/
|
*/
|
||||||
protected $keys;
|
protected $keys;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var mixed $key
|
* @var mixed $key
|
||||||
*/
|
*/
|
||||||
protected $key;
|
protected $key;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $index
|
* @var integer $index
|
||||||
*/
|
*/
|
||||||
protected $index;
|
protected $index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $count
|
* @var integer $count
|
||||||
*/
|
*/
|
||||||
@ -63,6 +68,7 @@ abstract class Doctrine_Collection_Iterator implements Iterator
|
|||||||
$this->keys = $this->collection->getKeys();
|
$this->keys = $this->collection->getKeys();
|
||||||
$this->count = $this->collection->count();
|
$this->count = $this->collection->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rewinds the iterator
|
* rewinds the iterator
|
||||||
*
|
*
|
||||||
@ -86,6 +92,7 @@ abstract class Doctrine_Collection_Iterator implements Iterator
|
|||||||
{
|
{
|
||||||
return $this->key;
|
return $this->key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the current record
|
* returns the current record
|
||||||
*
|
*
|
||||||
@ -95,6 +102,7 @@ abstract class Doctrine_Collection_Iterator implements Iterator
|
|||||||
{
|
{
|
||||||
return $this->collection->get($this->key);
|
return $this->collection->get($this->key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* advances the internal pointer
|
* advances the internal pointer
|
||||||
*
|
*
|
||||||
|
@ -37,6 +37,7 @@ class Doctrine_Collection_Offset extends Doctrine_Collection
|
|||||||
* @var integer $limit
|
* @var integer $limit
|
||||||
*/
|
*/
|
||||||
private $limit;
|
private $limit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Doctrine_Table $table
|
* @param Doctrine_Table $table
|
||||||
*/
|
*/
|
||||||
@ -45,6 +46,7 @@ class Doctrine_Collection_Offset extends Doctrine_Collection
|
|||||||
parent::__construct($table);
|
parent::__construct($table);
|
||||||
$this->limit = $table->getAttribute(Doctrine::ATTR_COLL_LIMIT);
|
$this->limit = $table->getAttribute(Doctrine::ATTR_COLL_LIMIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return integer
|
* @return integer
|
||||||
*/
|
*/
|
||||||
@ -52,6 +54,7 @@ class Doctrine_Collection_Offset extends Doctrine_Collection
|
|||||||
{
|
{
|
||||||
return $this->limit;
|
return $this->limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Doctrine_Collection_Iterator_Expandable
|
* @return Doctrine_Collection_Iterator_Expandable
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Column
|
* Doctrine_Column
|
||||||
* This class represents a database column
|
* This class represents a database column
|
||||||
@ -39,6 +40,7 @@ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Coun
|
|||||||
'type' => null,
|
'type' => null,
|
||||||
'length' => 0,
|
'length' => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $definition
|
* @var array $definition
|
||||||
*/
|
*/
|
||||||
@ -46,6 +48,7 @@ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Coun
|
|||||||
{
|
{
|
||||||
$this->_definition = $definition;
|
$this->_definition = $definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -53,6 +56,7 @@ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Coun
|
|||||||
{
|
{
|
||||||
return $this->_definition;
|
return $this->_definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* contains
|
* contains
|
||||||
*
|
*
|
||||||
@ -62,6 +66,7 @@ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Coun
|
|||||||
{
|
{
|
||||||
return isset($this->_definition[$name]);
|
return isset($this->_definition[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get
|
* get
|
||||||
*
|
*
|
||||||
@ -76,6 +81,7 @@ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Coun
|
|||||||
|
|
||||||
return $this->_definition[$name];
|
return $this->_definition[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set
|
* set
|
||||||
*
|
*
|
||||||
@ -86,6 +92,7 @@ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Coun
|
|||||||
{
|
{
|
||||||
$this->_definition[$name] = $value;
|
$this->_definition[$name] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $field
|
* @param string $field
|
||||||
* @return array
|
* @return array
|
||||||
@ -98,6 +105,7 @@ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Coun
|
|||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enumValue
|
* enumValue
|
||||||
*
|
*
|
||||||
@ -113,6 +121,7 @@ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Coun
|
|||||||
|
|
||||||
return isset($this->_definition['values'][$index]) ? $this->_definition['values'][$index] : $index;
|
return isset($this->_definition['values'][$index]) ? $this->_definition['values'][$index] : $index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enumIndex
|
* enumIndex
|
||||||
*
|
*
|
||||||
@ -126,6 +135,7 @@ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Coun
|
|||||||
|
|
||||||
return array_search($value, $values);
|
return array_search($value, $values);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count
|
* count
|
||||||
*
|
*
|
||||||
@ -135,6 +145,7 @@ class Doctrine_Column extends Doctrine_Access implements IteratorAggregate, Coun
|
|||||||
{
|
{
|
||||||
return count($this->_definition);
|
return count($this->_definition);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getIterator
|
* getIterator
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Compiler
|
* Doctrine_Compiler
|
||||||
* This class can be used for compiling the entire Doctrine framework into a single file
|
* This class can be used for compiling the entire Doctrine framework into a single file
|
||||||
@ -42,14 +43,14 @@ class Doctrine_Compiler
|
|||||||
*/
|
*/
|
||||||
public static function compile($target = null, $includedDrivers = array())
|
public static function compile($target = null, $includedDrivers = array())
|
||||||
{
|
{
|
||||||
if (!is_array($includedDrivers)) {
|
if ( ! is_array($includedDrivers)) {
|
||||||
$includedDrivers = array($includedDrivers);
|
$includedDrivers = array($includedDrivers);
|
||||||
}
|
}
|
||||||
|
|
||||||
$excludedDrivers = array();
|
$excludedDrivers = array();
|
||||||
|
|
||||||
// If we have an array of specified drivers then lets determine which drivers we should exclude
|
// If we have an array of specified drivers then lets determine which drivers we should exclude
|
||||||
if (!empty($includedDrivers)) {
|
if ( ! empty($includedDrivers)) {
|
||||||
$drivers = array('db2',
|
$drivers = array('db2',
|
||||||
'firebird',
|
'firebird',
|
||||||
'informix',
|
'informix',
|
||||||
@ -86,7 +87,7 @@ class Doctrine_Compiler
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Exclude drivers
|
// Exclude drivers
|
||||||
if (!empty($excludedDrivers)) {
|
if ( ! empty($excludedDrivers)) {
|
||||||
foreach ($excludedDrivers as $excludedDriver) {
|
foreach ($excludedDrivers as $excludedDriver) {
|
||||||
$excludedDriver = ucfirst($excludedDriver);
|
$excludedDriver = ucfirst($excludedDriver);
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Compiler_Exception
|
* Doctrine_Compiler_Exception
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Configurable
|
* Doctrine_Configurable
|
||||||
* the base for Doctrine_Table, Doctrine_Manager and Doctrine_Connection
|
* the base for Doctrine_Table, Doctrine_Manager and Doctrine_Connection
|
||||||
@ -37,16 +38,19 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
* @var array $attributes an array of containing all attributes
|
* @var array $attributes an array of containing all attributes
|
||||||
*/
|
*/
|
||||||
protected $attributes = array();
|
protected $attributes = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Configurable $parent the parent of this component
|
* @var Doctrine_Configurable $parent the parent of this component
|
||||||
*/
|
*/
|
||||||
protected $parent;
|
protected $parent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $_impl an array containing concrete implementations for class templates
|
* @var array $_impl an array containing concrete implementations for class templates
|
||||||
* keys as template names and values as names of the concrete
|
* keys as template names and values as names of the concrete
|
||||||
* implementation classes
|
* implementation classes
|
||||||
*/
|
*/
|
||||||
protected $_impl = array();
|
protected $_impl = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setAttribute
|
* setAttribute
|
||||||
* sets a given attribute
|
* sets a given attribute
|
||||||
@ -137,6 +141,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
$this->attributes[$attribute] = $value;
|
$this->attributes[$attribute] = $value;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setImpl
|
* setImpl
|
||||||
* binds given class to given template name
|
* binds given class to given template name
|
||||||
@ -153,6 +158,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getImpl
|
* getImpl
|
||||||
* returns the implementation for given class
|
* returns the implementation for given class
|
||||||
@ -169,6 +175,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
}
|
}
|
||||||
return $this->_impl[$template];
|
return $this->_impl[$template];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getCacheDriver
|
* getCacheDriver
|
||||||
*
|
*
|
||||||
@ -182,6 +189,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
|
|
||||||
return $this->attributes[Doctrine::ATTR_CACHE];
|
return $this->attributes[Doctrine::ATTR_CACHE];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Doctrine_EventListener $listener
|
* @param Doctrine_EventListener $listener
|
||||||
* @return void
|
* @return void
|
||||||
@ -190,6 +198,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
{
|
{
|
||||||
return $this->setListener($listener);
|
return $this->setListener($listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addRecordListener
|
* addRecordListener
|
||||||
*
|
*
|
||||||
@ -207,6 +216,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getListener
|
* getListener
|
||||||
*
|
*
|
||||||
@ -222,6 +232,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
}
|
}
|
||||||
return $this->attributes[Doctrine::ATTR_RECORD_LISTENER];
|
return $this->attributes[Doctrine::ATTR_RECORD_LISTENER];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setListener
|
* setListener
|
||||||
*
|
*
|
||||||
@ -239,6 +250,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addListener
|
* addListener
|
||||||
*
|
*
|
||||||
@ -256,6 +268,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getListener
|
* getListener
|
||||||
*
|
*
|
||||||
@ -271,6 +284,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
}
|
}
|
||||||
return $this->attributes[Doctrine::ATTR_LISTENER];
|
return $this->attributes[Doctrine::ATTR_LISTENER];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setListener
|
* setListener
|
||||||
*
|
*
|
||||||
@ -288,6 +302,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the value of an attribute
|
* returns the value of an attribute
|
||||||
*
|
*
|
||||||
@ -310,6 +325,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
}
|
}
|
||||||
return $this->attributes[$attribute];
|
return $this->attributes[$attribute];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAttributes
|
* getAttributes
|
||||||
* returns all attributes as an array
|
* returns all attributes as an array
|
||||||
@ -320,6 +336,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
{
|
{
|
||||||
return $this->attributes;
|
return $this->attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sets a parent for this configurable component
|
* sets a parent for this configurable component
|
||||||
* the parent must be configurable component itself
|
* the parent must be configurable component itself
|
||||||
@ -331,6 +348,7 @@ abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
|
|||||||
{
|
{
|
||||||
$this->parent = $component;
|
$this->parent = $component;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getParent
|
* getParent
|
||||||
* returns the parent of this component
|
* returns the parent of this component
|
||||||
|
@ -59,31 +59,37 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
* @var $dbh the database handler
|
* @var $dbh the database handler
|
||||||
*/
|
*/
|
||||||
protected $dbh;
|
protected $dbh;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $tables an array containing all the initialized Doctrine_Table objects
|
* @var array $tables an array containing all the initialized Doctrine_Table objects
|
||||||
* keys representing Doctrine_Table component names and values as Doctrine_Table objects
|
* keys representing Doctrine_Table component names and values as Doctrine_Table objects
|
||||||
*/
|
*/
|
||||||
protected $tables = array();
|
protected $tables = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $driverName the name of this connection driver
|
* @var string $driverName the name of this connection driver
|
||||||
*/
|
*/
|
||||||
protected $driverName;
|
protected $driverName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var boolean $isConnected whether or not a connection has been established
|
* @var boolean $isConnected whether or not a connection has been established
|
||||||
*/
|
*/
|
||||||
protected $isConnected = false;
|
protected $isConnected = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $supported an array containing all features this driver supports,
|
* @var array $supported an array containing all features this driver supports,
|
||||||
* keys representing feature names and values as
|
* keys representing feature names and values as
|
||||||
* one of the following (true, false, 'emulated')
|
* one of the following (true, false, 'emulated')
|
||||||
*/
|
*/
|
||||||
protected $supported = array();
|
protected $supported = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $pendingAttributes An array of pending attributes. When setting attributes
|
* @var array $pendingAttributes An array of pending attributes. When setting attributes
|
||||||
* no connection is needed. When connected all the pending
|
* no connection is needed. When connected all the pending
|
||||||
* attributes are passed to the underlying adapter (usually PDO) instance.
|
* attributes are passed to the underlying adapter (usually PDO) instance.
|
||||||
*/
|
*/
|
||||||
protected $pendingAttributes = array();
|
protected $pendingAttributes = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $modules an array containing all modules
|
* @var array $modules an array containing all modules
|
||||||
* transaction Doctrine_Transaction driver, handles savepoint and transaction isolation abstraction
|
* transaction Doctrine_Transaction driver, handles savepoint and transaction isolation abstraction
|
||||||
@ -122,6 +128,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
'formatter' => false,
|
'formatter' => false,
|
||||||
'util' => false,
|
'util' => false,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $properties an array of connection properties
|
* @var array $properties an array of connection properties
|
||||||
*/
|
*/
|
||||||
@ -135,12 +142,14 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
'wildcards' => array('%', '_'),
|
'wildcards' => array('%', '_'),
|
||||||
'varchar_max_length' => 255,
|
'varchar_max_length' => 255,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $serverInfo
|
* @var array $serverInfo
|
||||||
*/
|
*/
|
||||||
protected $serverInfo = array();
|
protected $serverInfo = array();
|
||||||
|
|
||||||
protected $options = array();
|
protected $options = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $availableDrivers an array containing all availible drivers
|
* @var array $availableDrivers an array containing all availible drivers
|
||||||
*/
|
*/
|
||||||
@ -192,6 +201,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$this->getAttribute(Doctrine::ATTR_LISTENER)->onOpen($this);
|
$this->getAttribute(Doctrine::ATTR_LISTENER)->onOpen($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getOption
|
* getOption
|
||||||
*
|
*
|
||||||
@ -206,6 +216,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
return $this->options[$option];
|
return $this->options[$option];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAttribute
|
* getAttribute
|
||||||
* retrieves a database connection attribute
|
* retrieves a database connection attribute
|
||||||
@ -238,6 +249,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
return $this->pendingAttributes[$attribute];
|
return $this->pendingAttributes[$attribute];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an array of available PDO drivers
|
* returns an array of available PDO drivers
|
||||||
*/
|
*/
|
||||||
@ -245,6 +257,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return PDO::getAvailableDrivers();
|
return PDO::getAvailableDrivers();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setAttribute
|
* setAttribute
|
||||||
* sets an attribute
|
* sets an attribute
|
||||||
@ -266,6 +279,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getName
|
* getName
|
||||||
* returns the name of this driver
|
* returns the name of this driver
|
||||||
@ -276,6 +290,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->driverName;
|
return $this->driverName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __get
|
* __get
|
||||||
* lazy loads given module and returns it
|
* lazy loads given module and returns it
|
||||||
@ -314,6 +329,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $this->modules[$name];
|
return $this->modules[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the manager that created this connection
|
* returns the manager that created this connection
|
||||||
*
|
*
|
||||||
@ -323,6 +339,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->getParent();
|
return $this->getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the database handler of which this connection uses
|
* returns the database handler of which this connection uses
|
||||||
*
|
*
|
||||||
@ -334,6 +351,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $this->dbh;
|
return $this->dbh;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* connect
|
* connect
|
||||||
* connects into database
|
* connects into database
|
||||||
@ -393,6 +411,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
$this->_count++;
|
$this->_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* converts given driver name
|
* converts given driver name
|
||||||
*
|
*
|
||||||
@ -401,6 +420,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
public function driverName($name)
|
public function driverName($name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* supports
|
* supports
|
||||||
*
|
*
|
||||||
@ -413,6 +433,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
&& ($this->supported[$feature] === 'emulated'
|
&& ($this->supported[$feature] === 'emulated'
|
||||||
|| $this->supported[$feature]));
|
|| $this->supported[$feature]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT
|
* Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT
|
||||||
* query, except that if there is already a row in the table with the same
|
* query, except that if there is already a row in the table with the same
|
||||||
@ -479,6 +500,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $affectedRows;
|
return $affectedRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inserts a table row with specified data.
|
* Inserts a table row with specified data.
|
||||||
*
|
*
|
||||||
@ -517,6 +539,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the charset on the current connection
|
* Set the charset on the current connection
|
||||||
*
|
*
|
||||||
@ -528,6 +551,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Quote a string so it can be safely used as a table or column name
|
* Quote a string so it can be safely used as a table or column name
|
||||||
*
|
*
|
||||||
@ -571,6 +595,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
}
|
}
|
||||||
return $this->formatter->quoteIdentifier($str, $checkOption);
|
return $this->formatter->quoteIdentifier($str, $checkOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convertBooleans
|
* convertBooleans
|
||||||
* some drivers need the boolean values to be converted into integers
|
* some drivers need the boolean values to be converted into integers
|
||||||
@ -585,6 +610,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->formatter->convertBooleans($item);
|
return $this->formatter->convertBooleans($item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* quote
|
* quote
|
||||||
* quotes given input parameter
|
* quotes given input parameter
|
||||||
@ -597,6 +623,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->formatter->quote($input, $type);
|
return $this->formatter->quote($input, $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the date/time format for the current connection
|
* Set the date/time format for the current connection
|
||||||
*
|
*
|
||||||
@ -607,6 +634,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
public function setDateFormat($format = null)
|
public function setDateFormat($format = null)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchAll
|
* fetchAll
|
||||||
*
|
*
|
||||||
@ -618,6 +646,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetchAll(Doctrine::FETCH_ASSOC);
|
return $this->execute($statement, $params)->fetchAll(Doctrine::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchOne
|
* fetchOne
|
||||||
*
|
*
|
||||||
@ -630,6 +659,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetchColumn($colnum);
|
return $this->execute($statement, $params)->fetchColumn($colnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchRow
|
* fetchRow
|
||||||
*
|
*
|
||||||
@ -641,6 +671,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetch(Doctrine::FETCH_ASSOC);
|
return $this->execute($statement, $params)->fetch(Doctrine::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchArray
|
* fetchArray
|
||||||
*
|
*
|
||||||
@ -652,6 +683,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetch(Doctrine::FETCH_NUM);
|
return $this->execute($statement, $params)->fetch(Doctrine::FETCH_NUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchColumn
|
* fetchColumn
|
||||||
*
|
*
|
||||||
@ -664,6 +696,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetchAll(Doctrine::FETCH_COLUMN, $colnum);
|
return $this->execute($statement, $params)->fetchAll(Doctrine::FETCH_COLUMN, $colnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchAssoc
|
* fetchAssoc
|
||||||
*
|
*
|
||||||
@ -675,6 +708,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetchAll(Doctrine::FETCH_ASSOC);
|
return $this->execute($statement, $params)->fetchAll(Doctrine::FETCH_ASSOC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchBoth
|
* fetchBoth
|
||||||
*
|
*
|
||||||
@ -686,6 +720,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($statement, $params)->fetchAll(Doctrine::FETCH_BOTH);
|
return $this->execute($statement, $params)->fetchAll(Doctrine::FETCH_BOTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* query
|
* query
|
||||||
* queries the database using Doctrine Query Language
|
* queries the database using Doctrine Query Language
|
||||||
@ -709,6 +744,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $parser->query($query, $params, $hydrationMode);
|
return $parser->query($query, $params, $hydrationMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prepare
|
* prepare
|
||||||
*
|
*
|
||||||
@ -737,6 +773,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$this->rethrowException($e, $this);
|
$this->rethrowException($e, $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* query
|
* query
|
||||||
* queries the database using Doctrine Query Language and returns
|
* queries the database using Doctrine Query Language and returns
|
||||||
@ -766,6 +803,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
}
|
}
|
||||||
return $coll[0];
|
return $coll[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queries the database with limit and offset
|
* queries the database with limit and offset
|
||||||
* added to the query and returns a Doctrine_Connection_Statement object
|
* added to the query and returns a Doctrine_Connection_Statement object
|
||||||
@ -782,6 +820,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
}
|
}
|
||||||
return $this->execute($query);
|
return $this->execute($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* standaloneQuery
|
* standaloneQuery
|
||||||
*
|
*
|
||||||
@ -794,6 +833,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->execute($query, $params);
|
return $this->execute($query, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute
|
* execute
|
||||||
* @param string $query sql query
|
* @param string $query sql query
|
||||||
@ -829,6 +869,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$this->rethrowException($e, $this);
|
$this->rethrowException($e, $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exec
|
* exec
|
||||||
* @param string $query sql query
|
* @param string $query sql query
|
||||||
@ -864,6 +905,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$this->rethrowException($e, $this);
|
$this->rethrowException($e, $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rethrowException
|
* rethrowException
|
||||||
*
|
*
|
||||||
@ -889,6 +931,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$this->getListener()->postError($event);
|
$this->getListener()->postError($event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasTable
|
* hasTable
|
||||||
* whether or not this connection has table $name initialized
|
* whether or not this connection has table $name initialized
|
||||||
@ -900,6 +943,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return isset($this->tables[$name]);
|
return isset($this->tables[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a table object for given component name
|
* returns a table object for given component name
|
||||||
*
|
*
|
||||||
@ -923,6 +967,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $table;
|
return $table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an array of all initialized tables
|
* returns an array of all initialized tables
|
||||||
*
|
*
|
||||||
@ -932,6 +977,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->tables;
|
return $this->tables;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns an iterator that iterators through all
|
* returns an iterator that iterators through all
|
||||||
* initialized table objects
|
* initialized table objects
|
||||||
@ -948,6 +994,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return new ArrayIterator($this->tables);
|
return new ArrayIterator($this->tables);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the count of initialized table objects
|
* returns the count of initialized table objects
|
||||||
*
|
*
|
||||||
@ -957,6 +1004,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->_count;
|
return $this->_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addTable
|
* addTable
|
||||||
* adds a Doctrine_Table object into connection registry
|
* adds a Doctrine_Table object into connection registry
|
||||||
@ -974,6 +1022,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
$this->tables[$name] = $table;
|
$this->tables[$name] = $table;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create
|
* create
|
||||||
* creates a record
|
* creates a record
|
||||||
@ -986,6 +1035,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->getTable($name)->create();
|
return $this->getTable($name)->create();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* flush
|
* flush
|
||||||
* saves all the records from all tables
|
* saves all the records from all tables
|
||||||
@ -1000,6 +1050,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
$this->unitOfWork->saveAll();
|
$this->unitOfWork->saveAll();
|
||||||
$this->commit();
|
$this->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clear
|
* clear
|
||||||
* clears all repositories
|
* clears all repositories
|
||||||
@ -1013,6 +1064,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
$table->clear();
|
$table->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* evictTables
|
* evictTables
|
||||||
* evicts all tables
|
* evicts all tables
|
||||||
@ -1024,6 +1076,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
$this->tables = array();
|
$this->tables = array();
|
||||||
$this->exported = array();
|
$this->exported = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* close
|
* close
|
||||||
* closes the connection
|
* closes the connection
|
||||||
@ -1043,6 +1096,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
$this->getAttribute(Doctrine::ATTR_LISTENER)->postClose($event);
|
$this->getAttribute(Doctrine::ATTR_LISTENER)->postClose($event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the current transaction nesting level
|
* get the current transaction nesting level
|
||||||
*
|
*
|
||||||
@ -1052,6 +1106,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->transaction->getTransactionLevel();
|
return $this->transaction->getTransactionLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* errorCode
|
* errorCode
|
||||||
* Fetch the SQLSTATE associated with the last operation on the database handle
|
* Fetch the SQLSTATE associated with the last operation on the database handle
|
||||||
@ -1064,6 +1119,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $this->dbh->errorCode();
|
return $this->dbh->errorCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* errorInfo
|
* errorInfo
|
||||||
* Fetch extended error information associated with the last operation on the database handle
|
* Fetch extended error information associated with the last operation on the database handle
|
||||||
@ -1076,6 +1132,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
|
|
||||||
return $this->dbh->errorInfo();
|
return $this->dbh->errorInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* lastInsertId
|
* lastInsertId
|
||||||
*
|
*
|
||||||
@ -1092,6 +1149,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
return $this->sequence->lastInsertId($table, $field);
|
return $this->sequence->lastInsertId($table, $field);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* beginTransaction
|
* beginTransaction
|
||||||
* Start a transaction or set a savepoint.
|
* Start a transaction or set a savepoint.
|
||||||
@ -1109,6 +1167,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
$this->transaction->beginTransaction($savepoint);
|
$this->transaction->beginTransaction($savepoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* commit
|
* commit
|
||||||
* Commit the database changes done during a transaction that is in
|
* Commit the database changes done during a transaction that is in
|
||||||
@ -1126,6 +1185,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
{
|
{
|
||||||
$this->transaction->commit($savepoint);
|
$this->transaction->commit($savepoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rollback
|
* rollback
|
||||||
* Cancel any database changes done during a transaction or since a specific
|
* Cancel any database changes done during a transaction or since a specific
|
||||||
|
@ -69,12 +69,14 @@ class Doctrine_Connection_Exception extends Doctrine_Exception
|
|||||||
Doctrine::ERR_TRUNCATED => 'truncated',
|
Doctrine::ERR_TRUNCATED => 'truncated',
|
||||||
Doctrine::ERR_DEADLOCK => 'deadlock detected',
|
Doctrine::ERR_DEADLOCK => 'deadlock detected',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Doctrine::ERR_* constants
|
* @see Doctrine::ERR_* constants
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
* @var integer $portableCode portable error code
|
* @var integer $portableCode portable error code
|
||||||
*/
|
*/
|
||||||
protected $portableCode;
|
protected $portableCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getPortableCode
|
* getPortableCode
|
||||||
* returns portable error code
|
* returns portable error code
|
||||||
@ -85,6 +87,7 @@ class Doctrine_Connection_Exception extends Doctrine_Exception
|
|||||||
{
|
{
|
||||||
return $this->portableCode;
|
return $this->portableCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getPortableMessage
|
* getPortableMessage
|
||||||
* returns portable error message
|
* returns portable error message
|
||||||
@ -95,6 +98,7 @@ class Doctrine_Connection_Exception extends Doctrine_Exception
|
|||||||
{
|
{
|
||||||
return self::errorMessage($this->portableCode);
|
return self::errorMessage($this->portableCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a textual error message for a Doctrine error code
|
* Return a textual error message for a Doctrine error code
|
||||||
*
|
*
|
||||||
|
@ -38,6 +38,7 @@ class Doctrine_Connection_Firebird extends Doctrine_Connection
|
|||||||
* @var string $driverName the name of this connection driver
|
* @var string $driverName the name of this connection driver
|
||||||
*/
|
*/
|
||||||
protected $driverName = 'Firebird';
|
protected $driverName = 'Firebird';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the constructor
|
* the constructor
|
||||||
*
|
*
|
||||||
@ -77,6 +78,7 @@ class Doctrine_Connection_Firebird extends Doctrine_Connection
|
|||||||
*/
|
*/
|
||||||
parent::__construct($manager, $adapter);
|
parent::__construct($manager, $adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the charset on the current connection
|
* Set the charset on the current connection
|
||||||
*
|
*
|
||||||
@ -89,6 +91,7 @@ class Doctrine_Connection_Firebird extends Doctrine_Connection
|
|||||||
$query = 'SET NAMES '.$this->dbh->quote($charset);
|
$query = 'SET NAMES '.$this->dbh->quote($charset);
|
||||||
$this->exec($query);
|
$this->exec($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an driver-specific LIMIT clause to the query
|
* Adds an driver-specific LIMIT clause to the query
|
||||||
*
|
*
|
||||||
|
@ -68,6 +68,7 @@ class Doctrine_Connection_Firebird_Exception extends Doctrine_Connection_Excepti
|
|||||||
-923 => Doctrine::ERR_CONNECT_FAILED,
|
-923 => Doctrine::ERR_CONNECT_FAILED,
|
||||||
-924 => Doctrine::ERR_CONNECT_FAILED
|
-924 => Doctrine::ERR_CONNECT_FAILED
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $errorRegexps an array that is used for determining portable
|
* @var array $errorRegexps an array that is used for determining portable
|
||||||
* error code from a native database error message
|
* error code from a native database error message
|
||||||
@ -96,6 +97,7 @@ class Doctrine_Connection_Firebird_Exception extends Doctrine_Connection_Excepti
|
|||||||
'/table unknown/i'
|
'/table unknown/i'
|
||||||
=> Doctrine::ERR_NOSUCHTABLE,
|
=> Doctrine::ERR_NOSUCHTABLE,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method checks if native error code/message can be
|
* This method checks if native error code/message can be
|
||||||
* converted into a portable code and then adds this
|
* converted into a portable code and then adds this
|
||||||
|
@ -36,6 +36,7 @@ class Doctrine_Connection_Informix extends Doctrine_Connection
|
|||||||
* @var string $driverName the name of this connection driver
|
* @var string $driverName the name of this connection driver
|
||||||
*/
|
*/
|
||||||
protected $driverName = 'Informix';
|
protected $driverName = 'Informix';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the constructor
|
* the constructor
|
||||||
*
|
*
|
||||||
|
@ -37,6 +37,7 @@ class Doctrine_Connection_Mock extends Doctrine_Connection_Common
|
|||||||
* @var string $driverName the name of this connection driver
|
* @var string $driverName the name of this connection driver
|
||||||
*/
|
*/
|
||||||
protected $driverName = 'Mock';
|
protected $driverName = 'Mock';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the constructor
|
* the constructor
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Connection_Module
|
* Doctrine_Connection_Module
|
||||||
*
|
*
|
||||||
@ -36,10 +37,12 @@ class Doctrine_Connection_Module
|
|||||||
* module holds an instance of Doctrine_Connection
|
* module holds an instance of Doctrine_Connection
|
||||||
*/
|
*/
|
||||||
protected $conn;
|
protected $conn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $moduleName the name of this module
|
* @var string $moduleName the name of this module
|
||||||
*/
|
*/
|
||||||
protected $moduleName;
|
protected $moduleName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Doctrine_Connection $conn Doctrine_Connection object, every connection
|
* @param Doctrine_Connection $conn Doctrine_Connection object, every connection
|
||||||
* module holds an instance of Doctrine_Connection
|
* module holds an instance of Doctrine_Connection
|
||||||
@ -55,6 +58,7 @@ class Doctrine_Connection_Module
|
|||||||
|
|
||||||
$this->moduleName = $e[1];
|
$this->moduleName = $e[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getConnection
|
* getConnection
|
||||||
* returns the connection object this module uses
|
* returns the connection object this module uses
|
||||||
@ -65,6 +69,7 @@ class Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
return $this->conn;
|
return $this->conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getModuleName
|
* getModuleName
|
||||||
* returns the name of this module
|
* returns the name of this module
|
||||||
|
@ -37,6 +37,7 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection
|
|||||||
* @var string $driverName the name of this connection driver
|
* @var string $driverName the name of this connection driver
|
||||||
*/
|
*/
|
||||||
protected $driverName = 'Mssql';
|
protected $driverName = 'Mssql';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the constructor
|
* the constructor
|
||||||
*
|
*
|
||||||
@ -66,6 +67,7 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection
|
|||||||
|
|
||||||
parent::__construct($manager, $adapter);
|
parent::__construct($manager, $adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* quoteIdentifier
|
* quoteIdentifier
|
||||||
* Quote a string so it can be safely used as a table / column name
|
* Quote a string so it can be safely used as a table / column name
|
||||||
@ -84,6 +86,7 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection
|
|||||||
}
|
}
|
||||||
return '[' . str_replace(']', ']]', $identifier) . ']';
|
return '[' . str_replace(']', ']]', $identifier) . ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an adapter-specific LIMIT clause to the SELECT statement.
|
* Adds an adapter-specific LIMIT clause to the SELECT statement.
|
||||||
* [ borrowed from Zend Framework ]
|
* [ borrowed from Zend Framework ]
|
||||||
@ -129,6 +132,7 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection
|
|||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return version information about the server
|
* return version information about the server
|
||||||
*
|
*
|
||||||
@ -166,6 +170,7 @@ class Doctrine_Connection_Mssql extends Doctrine_Connection
|
|||||||
}
|
}
|
||||||
return $serverInfo;
|
return $serverInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if there's a sequence that exists.
|
* Checks if there's a sequence that exists.
|
||||||
*
|
*
|
||||||
|
@ -52,6 +52,7 @@ class Doctrine_Connection_Mssql_Exception extends Doctrine_Connection_Exception
|
|||||||
3701 => Doctrine::ERR_NOSUCHTABLE,
|
3701 => Doctrine::ERR_NOSUCHTABLE,
|
||||||
8134 => Doctrine::ERR_DIVZERO,
|
8134 => Doctrine::ERR_DIVZERO,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method checks if native error code/message can be
|
* This method checks if native error code/message can be
|
||||||
* converted into a portable code and then adds this
|
* converted into a portable code and then adds this
|
||||||
|
@ -37,6 +37,7 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common
|
|||||||
* @var string $driverName the name of this connection driver
|
* @var string $driverName the name of this connection driver
|
||||||
*/
|
*/
|
||||||
protected $driverName = 'Mysql';
|
protected $driverName = 'Mysql';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the constructor
|
* the constructor
|
||||||
*
|
*
|
||||||
@ -88,6 +89,7 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common
|
|||||||
|
|
||||||
parent::__construct($manager, $adapter);
|
parent::__construct($manager, $adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the charset on the current connection
|
* Set the charset on the current connection
|
||||||
*
|
*
|
||||||
@ -100,6 +102,7 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common
|
|||||||
$query = 'SET NAMES '.$this->dbh->quote($charset);
|
$query = 'SET NAMES '.$this->dbh->quote($charset);
|
||||||
$this->exec($query);
|
$this->exec($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT
|
* Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT
|
||||||
* query, except that if there is already a row in the table with the same
|
* query, except that if there is already a row in the table with the same
|
||||||
|
@ -62,6 +62,7 @@ class Doctrine_Connection_Mysql_Exception extends Doctrine_Connection_Exception
|
|||||||
1216 => Doctrine::ERR_CONSTRAINT,
|
1216 => Doctrine::ERR_CONSTRAINT,
|
||||||
1217 => Doctrine::ERR_CONSTRAINT,
|
1217 => Doctrine::ERR_CONSTRAINT,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method checks if native error code/message can be
|
* This method checks if native error code/message can be
|
||||||
* converted into a portable code and then adds this
|
* converted into a portable code and then adds this
|
||||||
|
@ -70,6 +70,7 @@ class Doctrine_Connection_Oracle extends Doctrine_Connection
|
|||||||
*/
|
*/
|
||||||
parent::__construct($manager, $adapter);
|
parent::__construct($manager, $adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up the date/time format
|
* Sets up the date/time format
|
||||||
*
|
*
|
||||||
@ -78,6 +79,7 @@ class Doctrine_Connection_Oracle extends Doctrine_Connection
|
|||||||
{
|
{
|
||||||
$this->exec('ALTER SESSION SET NLS_DATE_FORMAT = "' . $format . '"');
|
$this->exec('ALTER SESSION SET NLS_DATE_FORMAT = "' . $format . '"');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds an driver-specific LIMIT clause to the query
|
* Adds an driver-specific LIMIT clause to the query
|
||||||
*
|
*
|
||||||
|
@ -57,6 +57,7 @@ class Doctrine_Connection_Oracle_Exception extends Doctrine_Connection_Exception
|
|||||||
2292 => Doctrine::ERR_CONSTRAINT,
|
2292 => Doctrine::ERR_CONSTRAINT,
|
||||||
2449 => Doctrine::ERR_CONSTRAINT,
|
2449 => Doctrine::ERR_CONSTRAINT,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method checks if native error code/message can be
|
* This method checks if native error code/message can be
|
||||||
* converted into a portable code and then adds this
|
* converted into a portable code and then adds this
|
||||||
|
@ -37,6 +37,7 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common
|
|||||||
* @var string $driverName the name of this connection driver
|
* @var string $driverName the name of this connection driver
|
||||||
*/
|
*/
|
||||||
protected $driverName = 'Pgsql';
|
protected $driverName = 'Pgsql';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the constructor
|
* the constructor
|
||||||
*
|
*
|
||||||
@ -77,6 +78,7 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common
|
|||||||
'escape' => '"');
|
'escape' => '"');
|
||||||
parent::__construct($manager, $adapter);
|
parent::__construct($manager, $adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the charset on the current connection
|
* Set the charset on the current connection
|
||||||
*
|
*
|
||||||
@ -89,6 +91,7 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common
|
|||||||
$query = 'SET NAMES '.$this->dbh->quote($charset);
|
$query = 'SET NAMES '.$this->dbh->quote($charset);
|
||||||
$this->exec($query);
|
$this->exec($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convertBoolean
|
* convertBoolean
|
||||||
* some drivers need the boolean values to be converted into integers
|
* some drivers need the boolean values to be converted into integers
|
||||||
@ -114,6 +117,7 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common
|
|||||||
}
|
}
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes a query string for various DBMS specific reasons
|
* Changes a query string for various DBMS specific reasons
|
||||||
*
|
*
|
||||||
@ -150,6 +154,7 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common
|
|||||||
}
|
}
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return version information about the server
|
* return version information about the server
|
||||||
*
|
*
|
||||||
|
@ -80,6 +80,7 @@ class Doctrine_Connection_Pgsql_Exception extends Doctrine_Connection_Exception
|
|||||||
'/more expressions than target columns/i'
|
'/more expressions than target columns/i'
|
||||||
=> Doctrine::ERR_VALUE_COUNT_ON_ROW,
|
=> Doctrine::ERR_VALUE_COUNT_ON_ROW,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method checks if native error code/message can be
|
* This method checks if native error code/message can be
|
||||||
* converted into a portable code and then adds this
|
* converted into a portable code and then adds this
|
||||||
|
@ -44,16 +44,19 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
|
|||||||
'exec',
|
'exec',
|
||||||
'execute',
|
'execute',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $events an array containing all listened events
|
* @param array $events an array containing all listened events
|
||||||
*/
|
*/
|
||||||
private $events = array();
|
private $events = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setFilterQueryType
|
* setFilterQueryType
|
||||||
*
|
*
|
||||||
@ -105,6 +108,7 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get
|
* get
|
||||||
*
|
*
|
||||||
@ -118,6 +122,7 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAll
|
* getAll
|
||||||
* returns all profiled events as an array
|
* returns all profiled events as an array
|
||||||
@ -128,6 +133,7 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
|
|||||||
{
|
{
|
||||||
return $this->events;
|
return $this->events;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getIterator
|
* getIterator
|
||||||
* returns an iterator that iterates through the logged events
|
* returns an iterator that iterates through the logged events
|
||||||
@ -138,6 +144,7 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
|
|||||||
{
|
{
|
||||||
return new ArrayIterator($this->events);
|
return new ArrayIterator($this->events);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* count
|
* count
|
||||||
*
|
*
|
||||||
@ -147,6 +154,7 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
|
|||||||
{
|
{
|
||||||
return count($this->events);
|
return count($this->events);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pop the last event from the event stack
|
* pop the last event from the event stack
|
||||||
*
|
*
|
||||||
@ -156,6 +164,7 @@ class Doctrine_Connection_Profiler implements Doctrine_Overloadable, IteratorAgg
|
|||||||
{
|
{
|
||||||
return array_pop($this->events);
|
return array_pop($this->events);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Doctrine_Event object for the last query that was run, regardless if it has
|
* Get the Doctrine_Event object for the last query that was run, regardless if it has
|
||||||
* ended or not. If the event has not ended, it's end time will be Null.
|
* ended or not. If the event has not ended, it's end time will be Null.
|
||||||
|
@ -37,6 +37,7 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common
|
|||||||
* @var string $driverName the name of this connection driver
|
* @var string $driverName the name of this connection driver
|
||||||
*/
|
*/
|
||||||
protected $driverName = 'Sqlite';
|
protected $driverName = 'Sqlite';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the constructor
|
* the constructor
|
||||||
*
|
*
|
||||||
@ -82,6 +83,7 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common
|
|||||||
$this->dbh->sqliteCreateFunction('now', 'time', 0);
|
$this->dbh->sqliteCreateFunction('now', 'time', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initializes database functions missing in sqlite
|
* initializes database functions missing in sqlite
|
||||||
*
|
*
|
||||||
@ -101,6 +103,7 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common
|
|||||||
$this->dbh->sqliteCreateFunction('md5', 'md5', 1);
|
$this->dbh->sqliteCreateFunction('md5', 'md5', 1);
|
||||||
$this->dbh->sqliteCreateFunction('now', 'time', 0);
|
$this->dbh->sqliteCreateFunction('now', 'time', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDatabaseFile
|
* getDatabaseFile
|
||||||
*
|
*
|
||||||
|
@ -51,6 +51,7 @@ class Doctrine_Connection_Sqlite_Exception extends Doctrine_Connection_Exception
|
|||||||
'/^near ".*": syntax error$/' => Doctrine::ERR_SYNTAX,
|
'/^near ".*": syntax error$/' => Doctrine::ERR_SYNTAX,
|
||||||
'/[0-9]+ values for [0-9]+ columns/i' => Doctrine::ERR_VALUE_COUNT_ON_ROW,
|
'/[0-9]+ values for [0-9]+ columns/i' => Doctrine::ERR_VALUE_COUNT_ON_ROW,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method checks if native error code/message can be
|
* This method checks if native error code/message can be
|
||||||
* converted into a portable code and then adds this
|
* converted into a portable code and then adds this
|
||||||
|
@ -37,10 +37,12 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
* statement holds an instance of Doctrine_Connection
|
* statement holds an instance of Doctrine_Connection
|
||||||
*/
|
*/
|
||||||
protected $_conn;
|
protected $_conn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var mixed $_stmt PDOStatement object, boolean false or Doctrine_Adapter_Statement object
|
* @var mixed $_stmt PDOStatement object, boolean false or Doctrine_Adapter_Statement object
|
||||||
*/
|
*/
|
||||||
protected $_stmt;
|
protected $_stmt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*
|
*
|
||||||
@ -57,6 +59,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
throw new Doctrine_Exception('Unknown statement object given.');
|
throw new Doctrine_Exception('Unknown statement object given.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getConnection
|
* getConnection
|
||||||
* returns the connection object this statement uses
|
* returns the connection object this statement uses
|
||||||
@ -75,6 +78,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->queryString;
|
return $this->_stmt->queryString;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bindColumn
|
* bindColumn
|
||||||
* Bind a column to a PHP variable
|
* Bind a column to a PHP variable
|
||||||
@ -95,6 +99,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
return $this->_stmt->bindColumn($column, $param, $type);
|
return $this->_stmt->bindColumn($column, $param, $type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bindValue
|
* bindValue
|
||||||
* Binds a value to a corresponding named or question mark
|
* Binds a value to a corresponding named or question mark
|
||||||
@ -117,6 +122,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
return $this->_stmt->bindValue($param, $value, $type);
|
return $this->_stmt->bindValue($param, $value, $type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bindParam
|
* bindParam
|
||||||
* Binds a PHP variable to a corresponding named or question mark placeholder in the
|
* Binds a PHP variable to a corresponding named or question mark placeholder in the
|
||||||
@ -152,6 +158,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
return $this->_stmt->bindParam($column, $variable, $type, $length, $driverOptions);
|
return $this->_stmt->bindParam($column, $variable, $type, $length, $driverOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* closeCursor
|
* closeCursor
|
||||||
* Closes the cursor, enabling the statement to be executed again.
|
* Closes the cursor, enabling the statement to be executed again.
|
||||||
@ -162,6 +169,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->closeCursor();
|
return $this->_stmt->closeCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* columnCount
|
* columnCount
|
||||||
* Returns the number of columns in the result set
|
* Returns the number of columns in the result set
|
||||||
@ -174,6 +182,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->columnCount();
|
return $this->_stmt->columnCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* errorCode
|
* errorCode
|
||||||
* Fetch the SQLSTATE associated with the last operation on the statement handle
|
* Fetch the SQLSTATE associated with the last operation on the statement handle
|
||||||
@ -185,6 +194,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->errorCode();
|
return $this->_stmt->errorCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* errorInfo
|
* errorInfo
|
||||||
* Fetch extended error information associated with the last operation on the statement handle
|
* Fetch extended error information associated with the last operation on the statement handle
|
||||||
@ -196,6 +206,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->errorInfo();
|
return $this->_stmt->errorInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute
|
* execute
|
||||||
* Executes a prepared statement
|
* Executes a prepared statement
|
||||||
@ -234,6 +245,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetch
|
* fetch
|
||||||
*
|
*
|
||||||
@ -281,6 +293,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchAll
|
* fetchAll
|
||||||
* Returns an array containing all of the result set rows
|
* Returns an array containing all of the result set rows
|
||||||
@ -317,6 +330,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchColumn
|
* fetchColumn
|
||||||
* Returns a single column from the next row of a
|
* Returns a single column from the next row of a
|
||||||
@ -332,6 +346,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->fetchColumn($columnIndex);
|
return $this->_stmt->fetchColumn($columnIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fetchObject
|
* fetchObject
|
||||||
* Fetches the next row and returns it as an object.
|
* Fetches the next row and returns it as an object.
|
||||||
@ -349,6 +364,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->fetchObject($className, $args);
|
return $this->_stmt->fetchObject($className, $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAttribute
|
* getAttribute
|
||||||
* Retrieve a statement attribute
|
* Retrieve a statement attribute
|
||||||
@ -361,6 +377,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->getAttribute($attribute);
|
return $this->_stmt->getAttribute($attribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getColumnMeta
|
* getColumnMeta
|
||||||
* Returns metadata for a column in a result set
|
* Returns metadata for a column in a result set
|
||||||
@ -381,6 +398,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->getColumnMeta($column);
|
return $this->_stmt->getColumnMeta($column);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nextRowset
|
* nextRowset
|
||||||
* Advances to the next rowset in a multi-rowset statement handle
|
* Advances to the next rowset in a multi-rowset statement handle
|
||||||
@ -396,6 +414,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->nextRowset();
|
return $this->_stmt->nextRowset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rowCount
|
* rowCount
|
||||||
* rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
|
* rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
|
||||||
@ -412,6 +431,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->rowCount();
|
return $this->_stmt->rowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setAttribute
|
* setAttribute
|
||||||
* Set a statement attribute
|
* Set a statement attribute
|
||||||
@ -424,6 +444,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf
|
|||||||
{
|
{
|
||||||
return $this->_stmt->setAttribute($attribute, $value);
|
return $this->_stmt->setAttribute($attribute, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setFetchMode
|
* setFetchMode
|
||||||
* Set the default fetch mode for this statement
|
* Set the default fetch mode for this statement
|
||||||
|
@ -131,6 +131,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
return array_values($tree);
|
return array_values($tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* saves the given record
|
* saves the given record
|
||||||
*
|
*
|
||||||
@ -210,6 +211,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* saves the given record
|
* saves the given record
|
||||||
*
|
*
|
||||||
@ -244,6 +246,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
$record->postSave($event);
|
$record->postSave($event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deletes given record and all the related composites
|
* deletes given record and all the related composites
|
||||||
* this operation is isolated by a transaction
|
* this operation is isolated by a transaction
|
||||||
@ -310,6 +313,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $this->conn->exec($query, $params);
|
return $this->conn->exec($query, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deleteMultiple
|
* deleteMultiple
|
||||||
* deletes all records from the pending delete list
|
* deletes all records from the pending delete list
|
||||||
@ -362,6 +366,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* saveRelated
|
* saveRelated
|
||||||
* saves all related records to $record
|
* saves all related records to $record
|
||||||
@ -401,6 +406,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $saveLater;
|
return $saveLater;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* saveAssociations
|
* saveAssociations
|
||||||
*
|
*
|
||||||
@ -443,6 +449,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deletes all related composites
|
* deletes all related composites
|
||||||
* this method is always called internally when a record is deleted
|
* this method is always called internally when a record is deleted
|
||||||
@ -464,6 +471,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* saveAll
|
* saveAll
|
||||||
* persists all the pending records from all tables
|
* persists all the pending records from all tables
|
||||||
@ -494,6 +502,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* update
|
* update
|
||||||
* updates the given record
|
* updates the given record
|
||||||
@ -560,6 +569,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* inserts a record into database
|
* inserts a record into database
|
||||||
*
|
*
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
/**
|
/**
|
||||||
* Doctrine_Data
|
* Doctrine_Data
|
||||||
*
|
*
|
||||||
* Base Doctrine_Data class
|
* Base Doctrine_Data class for dumping and loading data to and from fixtures files.
|
||||||
|
* Support formats are based on what formats are available in Doctrine_Parser such as yaml, xml, json, etc.
|
||||||
*
|
*
|
||||||
* @package Doctrine
|
* @package Doctrine
|
||||||
* @subpackage Data
|
* @subpackage Data
|
||||||
@ -42,6 +43,7 @@ class Doctrine_Data
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $formats = array('csv', 'yml', 'xml');
|
public $formats = array('csv', 'yml', 'xml');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* format
|
* format
|
||||||
*
|
*
|
||||||
@ -50,6 +52,7 @@ class Doctrine_Data
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $format = 'yml';
|
public $format = 'yml';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* directory
|
* directory
|
||||||
*
|
*
|
||||||
@ -58,6 +61,7 @@ class Doctrine_Data
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $directory = null;
|
public $directory = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* models
|
* models
|
||||||
*
|
*
|
||||||
@ -66,6 +70,7 @@ class Doctrine_Data
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $models = array();
|
public $models = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportIndividualFiles
|
* exportIndividualFiles
|
||||||
*
|
*
|
||||||
@ -74,6 +79,7 @@ class Doctrine_Data
|
|||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $exportIndividualFiles = false;
|
public $exportIndividualFiles = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setFormat
|
* setFormat
|
||||||
*
|
*
|
||||||
@ -81,58 +87,60 @@ class Doctrine_Data
|
|||||||
*
|
*
|
||||||
* @param string $format
|
* @param string $format
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function setFormat($format)
|
public function setFormat($format)
|
||||||
{
|
{
|
||||||
$this->format = $format;
|
$this->format = $format;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getFormat
|
* getFormat
|
||||||
*
|
*
|
||||||
* Get the current format we are working with
|
* Get the current format we are working with
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function getFormat()
|
public function getFormat()
|
||||||
{
|
{
|
||||||
return $this->format;
|
return $this->format;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getFormats
|
* getFormats
|
||||||
*
|
*
|
||||||
* Get array of available formats
|
* Get array of available formats
|
||||||
*
|
*
|
||||||
* @author Jonathan H. Wage
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function getFormats()
|
public function getFormats()
|
||||||
{
|
{
|
||||||
return $this->formats;
|
return $this->formats;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setDirectory
|
* setDirectory
|
||||||
*
|
*
|
||||||
* Set the array/string of directories or yml file paths
|
* Set the array/string of directories or yml file paths
|
||||||
*
|
*
|
||||||
* @author Jonathan H. Wage
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setDirectory($directory)
|
public function setDirectory($directory)
|
||||||
{
|
{
|
||||||
$this->directory = $directory;
|
$this->directory = $directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDirectory
|
* getDirectory
|
||||||
*
|
*
|
||||||
* Get directory to work with
|
* Get directory for dumping/loading data from and to
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function getDirectory()
|
public function getDirectory()
|
||||||
{
|
{
|
||||||
return $this->directory;
|
return $this->directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setModels
|
* setModels
|
||||||
*
|
*
|
||||||
@ -140,30 +148,30 @@ class Doctrine_Data
|
|||||||
*
|
*
|
||||||
* @param string $models
|
* @param string $models
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function setModels($models)
|
public function setModels($models)
|
||||||
{
|
{
|
||||||
$this->models = $models;
|
$this->models = $models;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getModels
|
* getModels
|
||||||
*
|
*
|
||||||
* Get the array of specified models to work with
|
* Get the array of specified models to work with
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function getModels()
|
public function getModels()
|
||||||
{
|
{
|
||||||
return $this->models;
|
return $this->models;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportIndividualFiles
|
* exportIndividualFiles
|
||||||
*
|
*
|
||||||
* Set/Get whether or not to export individual files
|
* Set/Get whether or not to export individual files
|
||||||
*
|
*
|
||||||
* @author Jonathan H. Wage
|
* @return bool $exportIndividualFiles
|
||||||
*/
|
*/
|
||||||
public function exportIndividualFiles($bool = null)
|
public function exportIndividualFiles($bool = null)
|
||||||
{
|
{
|
||||||
@ -173,6 +181,7 @@ class Doctrine_Data
|
|||||||
|
|
||||||
return $this->exportIndividualFiles;
|
return $this->exportIndividualFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportData
|
* exportData
|
||||||
*
|
*
|
||||||
@ -183,7 +192,6 @@ class Doctrine_Data
|
|||||||
* @param string $models
|
* @param string $models
|
||||||
* @param string $exportIndividualFiles
|
* @param string $exportIndividualFiles
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function exportData($directory, $format = 'yml', $models = array(), $exportIndividualFiles = false)
|
public function exportData($directory, $format = 'yml', $models = array(), $exportIndividualFiles = false)
|
||||||
{
|
{
|
||||||
@ -194,6 +202,7 @@ class Doctrine_Data
|
|||||||
|
|
||||||
return $export->doExport();
|
return $export->doExport();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* importData
|
* importData
|
||||||
*
|
*
|
||||||
@ -203,7 +212,6 @@ class Doctrine_Data
|
|||||||
* @param string $format
|
* @param string $format
|
||||||
* @param string $models
|
* @param string $models
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function importData($directory, $format = 'yml', $models = array())
|
public function importData($directory, $format = 'yml', $models = array())
|
||||||
{
|
{
|
||||||
@ -213,6 +221,7 @@ class Doctrine_Data
|
|||||||
|
|
||||||
return $import->doImport();
|
return $import->doImport();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* importDummyData
|
* importDummyData
|
||||||
*
|
*
|
||||||
@ -221,7 +230,6 @@ class Doctrine_Data
|
|||||||
* @param string $num
|
* @param string $num
|
||||||
* @param string $models
|
* @param string $models
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function importDummyData($num = 3, $models = array())
|
public function importDummyData($num = 3, $models = array())
|
||||||
{
|
{
|
||||||
@ -230,6 +238,7 @@ class Doctrine_Data
|
|||||||
|
|
||||||
return $import->doImportDummyData($num);
|
return $import->doImportDummyData($num);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* isRelation
|
* isRelation
|
||||||
*
|
*
|
||||||
@ -254,7 +263,7 @@ class Doctrine_Data
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* purge
|
* purge
|
||||||
*
|
*
|
||||||
@ -272,6 +281,6 @@ class Doctrine_Data
|
|||||||
$model = new $model();
|
$model = new $model();
|
||||||
|
|
||||||
$model->getTable()->createQuery()->delete($model)->execute();
|
$model->getTable()->createQuery()->delete($model)->execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -37,17 +37,16 @@ class Doctrine_Data_Export extends Doctrine_Data
|
|||||||
*
|
*
|
||||||
* @param string $directory
|
* @param string $directory
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function __construct($directory)
|
public function __construct($directory)
|
||||||
{
|
{
|
||||||
$this->setDirectory($directory);
|
$this->setDirectory($directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* doExport
|
* doExport
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function doExport()
|
public function doExport()
|
||||||
{
|
{
|
||||||
@ -58,15 +57,14 @@ class Doctrine_Data_Export extends Doctrine_Data
|
|||||||
|
|
||||||
$outputAll = true;
|
$outputAll = true;
|
||||||
|
|
||||||
// for situation when the $models array is empty, but the $specifiedModels array isn't
|
// for situation when the $models array is empty, but the $specifiedModels array isn't
|
||||||
if (empty($models))
|
if (empty($models)) {
|
||||||
{
|
|
||||||
$models = $specifiedModels;
|
$models = $specifiedModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($models AS $name) {
|
foreach ($models AS $name) {
|
||||||
|
|
||||||
if (!empty($specifiedModels) AND !in_array($name, $specifiedModels)) {
|
if ( ! empty($specifiedModels) AND !in_array($name, $specifiedModels)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +72,7 @@ class Doctrine_Data_Export extends Doctrine_Data
|
|||||||
$table = $class->getTable();
|
$table = $class->getTable();
|
||||||
$result = $table->findAll();
|
$result = $table->findAll();
|
||||||
|
|
||||||
if (!empty($result)) {
|
if ( ! empty($result)) {
|
||||||
$data[$name] = $result;
|
$data[$name] = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,6 +81,7 @@ class Doctrine_Data_Export extends Doctrine_Data
|
|||||||
|
|
||||||
return $this->dumpData($data);
|
return $this->dumpData($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dumpData
|
* dumpData
|
||||||
*
|
*
|
||||||
@ -90,7 +89,6 @@ class Doctrine_Data_Export extends Doctrine_Data
|
|||||||
*
|
*
|
||||||
* @param string $array
|
* @param string $array
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function dumpData(array $data)
|
public function dumpData(array $data)
|
||||||
{
|
{
|
||||||
@ -101,12 +99,12 @@ class Doctrine_Data_Export extends Doctrine_Data
|
|||||||
|
|
||||||
if (is_array($directory)) {
|
if (is_array($directory)) {
|
||||||
throw new Doctrine_Data_Exception('You must specify a single path to a folder in order to export individual files.');
|
throw new Doctrine_Data_Exception('You must specify a single path to a folder in order to export individual files.');
|
||||||
} else if (!is_dir($directory) && is_file($directory)) {
|
} else if ( ! is_dir($directory) && is_file($directory)) {
|
||||||
$directory = dirname($directory);
|
$directory = dirname($directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($data as $className => $classData) {
|
foreach ($data as $className => $classData) {
|
||||||
if (!empty($classData)) {
|
if ( ! empty($classData)) {
|
||||||
Doctrine_Parser::dump(array($className => $classData), $format, $directory.DIRECTORY_SEPARATOR.$className.'.'.$format);
|
Doctrine_Parser::dump(array($className => $classData), $format, $directory.DIRECTORY_SEPARATOR.$className.'.'.$format);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -115,11 +113,12 @@ class Doctrine_Data_Export extends Doctrine_Data
|
|||||||
throw new Doctrine_Data_Exception('You must specify the path to a '.$format.' file to export. You specified a directory.');
|
throw new Doctrine_Data_Exception('You must specify the path to a '.$format.' file to export. You specified a directory.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($data)) {
|
if ( ! empty($data)) {
|
||||||
return Doctrine_Parser::dump($data, $format, $directory);
|
return Doctrine_Parser::dump($data, $format, $directory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prepareData
|
* prepareData
|
||||||
*
|
*
|
||||||
@ -127,7 +126,6 @@ class Doctrine_Data_Export extends Doctrine_Data
|
|||||||
*
|
*
|
||||||
* @param string $data
|
* @param string $data
|
||||||
* @return array
|
* @return array
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function prepareData($data)
|
public function prepareData($data)
|
||||||
{
|
{
|
||||||
@ -142,14 +140,14 @@ class Doctrine_Data_Export extends Doctrine_Data
|
|||||||
$recordData = $record->toArray();
|
$recordData = $record->toArray();
|
||||||
|
|
||||||
foreach ($recordData as $key => $value) {
|
foreach ($recordData as $key => $value) {
|
||||||
if (!$value) {
|
if ( ! $value) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip single primary keys, we need to maintain composite primary keys
|
// skip single primary keys, we need to maintain composite primary keys
|
||||||
$keys = $record->getTable()->getIdentifier();
|
$keys = $record->getTable()->getIdentifier();
|
||||||
|
|
||||||
if (!is_array($keys)) {
|
if ( ! is_array($keys)) {
|
||||||
$keys = array($keys);
|
$keys = array($keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,20 +37,18 @@ class Doctrine_Data_Import extends Doctrine_Data
|
|||||||
*
|
*
|
||||||
* @param string $directory
|
* @param string $directory
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function __construct($directory = null)
|
public function __construct($directory = null)
|
||||||
{
|
{
|
||||||
if ($directory !== null) {
|
if ($directory !== null) {
|
||||||
$this->setDirectory($directory);
|
$this->setDirectory($directory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* doImport
|
* doImport
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function doImport()
|
public function doImport()
|
||||||
{
|
{
|
||||||
@ -82,12 +80,12 @@ class Doctrine_Data_Import extends Doctrine_Data
|
|||||||
|
|
||||||
$this->loadData($array);
|
$this->loadData($array);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loadData
|
* loadData
|
||||||
*
|
*
|
||||||
* @param string $array
|
* @param string $array
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
protected function loadData(array $array)
|
protected function loadData(array $array)
|
||||||
{
|
{
|
||||||
@ -99,7 +97,7 @@ class Doctrine_Data_Import extends Doctrine_Data
|
|||||||
|
|
||||||
foreach ($array as $className => $data) {
|
foreach ($array as $className => $data) {
|
||||||
|
|
||||||
if (!empty($specifiedModels) && !in_array($className, $specifiedModels)) {
|
if ( ! empty($specifiedModels) && !in_array($className, $specifiedModels)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,12 +147,12 @@ class Doctrine_Data_Import extends Doctrine_Data
|
|||||||
$obj->save();
|
$obj->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* doImportDummyData
|
* doImportDummyData
|
||||||
*
|
*
|
||||||
* @param string $num
|
* @param string $num
|
||||||
* @return void
|
* @return void
|
||||||
* @author Jonathan H. Wage
|
|
||||||
*/
|
*/
|
||||||
public function doImportDummyData($num = 3)
|
public function doImportDummyData($num = 3)
|
||||||
{
|
{
|
||||||
@ -163,7 +161,7 @@ class Doctrine_Data_Import extends Doctrine_Data
|
|||||||
$specifiedModels = $this->getModels();
|
$specifiedModels = $this->getModels();
|
||||||
|
|
||||||
foreach ($models as $name) {
|
foreach ($models as $name) {
|
||||||
if (!empty($specifiedModels) && !in_array($name, $specifiedModels)) {
|
if ( ! empty($specifiedModels) && !in_array($name, $specifiedModels)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,18 +179,24 @@ class Doctrine_Data_Import extends Doctrine_Data
|
|||||||
|
|
||||||
public function populateDummyRecord(Doctrine_Record $record)
|
public function populateDummyRecord(Doctrine_Record $record)
|
||||||
{
|
{
|
||||||
$lorem = explode(' ', "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.");
|
$lorem = explode(' ', "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem
|
||||||
|
Ipsum has been the industry's standard dummy text ever since the 1500s, when an
|
||||||
|
unknown printer took a galley of type and scrambled it to make a type specimen book.
|
||||||
|
It has survived not only five centuries, but also the leap into electronic
|
||||||
|
typesetting, remaining essentially unchanged. It was popularised in the 1960s with
|
||||||
|
the release of Letraset sheets containing Lorem Ipsum passages, and more recently
|
||||||
|
with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.");
|
||||||
|
|
||||||
$columns = array_keys($record->toArray());
|
$columns = array_keys($record->toArray());
|
||||||
$pks = $record->getTable()->getIdentifier();
|
$pks = $record->getTable()->getIdentifier();
|
||||||
|
|
||||||
if (!is_array($pks)) {
|
if ( ! is_array($pks)) {
|
||||||
$pks = array($pks);
|
$pks = array($pks);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($columns as $column) {
|
foreach ($columns as $column) {
|
||||||
|
|
||||||
if (!in_array($column, $pks)) {
|
if ( ! in_array($column, $pks)) {
|
||||||
if ($relation = $this->isRelation($record, $column)) {
|
if ($relation = $this->isRelation($record, $column)) {
|
||||||
$alias = $relation['alias'];
|
$alias = $relation['alias'];
|
||||||
$relationObj = $record->$alias;
|
$relationObj = $record->$alias;
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_DataDict
|
* Doctrine_DataDict
|
||||||
*
|
*
|
||||||
@ -73,6 +74,7 @@ class Doctrine_DataDict extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $change;
|
return $change;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parseBoolean
|
* parseBoolean
|
||||||
* parses a literal boolean value and returns
|
* parses a literal boolean value and returns
|
||||||
|
@ -99,6 +99,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
|
|||||||
|
|
||||||
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps a native array description of a field to a Doctrine datatype and length
|
* Maps a native array description of a field to a Doctrine datatype and length
|
||||||
*
|
*
|
||||||
@ -188,6 +189,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
|
|||||||
'unsigned' => $unsigned,
|
'unsigned' => $unsigned,
|
||||||
'fixed' => $fixed);
|
'fixed' => $fixed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
|
* Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
|
||||||
* of a field declaration to be used in statements like CREATE TABLE.
|
* of a field declaration to be used in statements like CREATE TABLE.
|
||||||
@ -200,6 +202,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
|
|||||||
{
|
{
|
||||||
return 'CHARACTER SET ' . $charset;
|
return 'CHARACTER SET ' . $charset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to set the COLLATION
|
* Obtain DBMS specific SQL code portion needed to set the COLLATION
|
||||||
* of a field declaration to be used in statements like CREATE TABLE.
|
* of a field declaration to be used in statements like CREATE TABLE.
|
||||||
|
@ -114,6 +114,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
|
|||||||
|
|
||||||
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps a native array description of a field to a MDB2 datatype and length
|
* Maps a native array description of a field to a MDB2 datatype and length
|
||||||
*
|
*
|
||||||
|
@ -228,6 +228,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
|
|||||||
}
|
}
|
||||||
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps a native array description of a field to a MDB2 datatype and length
|
* Maps a native array description of a field to a MDB2 datatype and length
|
||||||
*
|
*
|
||||||
@ -386,6 +387,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
|
|||||||
return array('type' => $type, 'length' => $length, 'unsigned' => $unsigned, 'fixed' => $fixed, 'values' => $values);
|
return array('type' => $type, 'length' => $length, 'unsigned' => $unsigned, 'fixed' => $fixed, 'values' => $values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
|
* Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
|
||||||
* of a field declaration to be used in statements like CREATE TABLE.
|
* of a field declaration to be used in statements like CREATE TABLE.
|
||||||
@ -398,6 +400,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
|
|||||||
{
|
{
|
||||||
return 'CHARACTER SET ' . $charset;
|
return 'CHARACTER SET ' . $charset;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to set the COLLATION
|
* Obtain DBMS specific SQL code portion needed to set the COLLATION
|
||||||
* of a field declaration to be used in statements like CREATE TABLE.
|
* of a field declaration to be used in statements like CREATE TABLE.
|
||||||
@ -410,6 +413,7 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
|
|||||||
{
|
{
|
||||||
return 'COLLATE ' . $collation;
|
return 'COLLATE ' . $collation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to declare an integer type
|
* Obtain DBMS specific SQL code portion needed to declare an integer type
|
||||||
* field to be used in statements like CREATE TABLE.
|
* field to be used in statements like CREATE TABLE.
|
||||||
|
@ -97,6 +97,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
|
|||||||
}
|
}
|
||||||
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps a native array description of a field to a doctrine datatype and length
|
* Maps a native array description of a field to a doctrine datatype and length
|
||||||
*
|
*
|
||||||
|
@ -422,6 +422,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
|
|||||||
}
|
}
|
||||||
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps a native array description of a field to a portable Doctrine datatype and length
|
* Maps a native array description of a field to a portable Doctrine datatype and length
|
||||||
*
|
*
|
||||||
@ -553,6 +554,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
|
|||||||
'unsigned' => $unsigned,
|
'unsigned' => $unsigned,
|
||||||
'fixed' => $fixed);
|
'fixed' => $fixed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to declare an integer type
|
* Obtain DBMS specific SQL code portion needed to declare an integer type
|
||||||
* field to be used in statements like CREATE TABLE.
|
* field to be used in statements like CREATE TABLE.
|
||||||
@ -606,6 +608,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
|
|||||||
$name = $this->conn->quoteIdentifier($name, true);
|
$name = $this->conn->quoteIdentifier($name, true);
|
||||||
return $name . ' ' . $this->getNativeDeclaration($field) . $default . $notnull;
|
return $name . ' ' . $this->getNativeDeclaration($field) . $default . $notnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parseBoolean
|
* parseBoolean
|
||||||
* parses a literal boolean value and returns
|
* parses a literal boolean value and returns
|
||||||
|
@ -119,6 +119,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
|
|||||||
}
|
}
|
||||||
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps a native array description of a field to Doctrine datatype and length
|
* Maps a native array description of a field to Doctrine datatype and length
|
||||||
*
|
*
|
||||||
@ -240,6 +241,7 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
|
|||||||
'unsigned' => $unsigned,
|
'unsigned' => $unsigned,
|
||||||
'fixed' => $fixed);
|
'fixed' => $fixed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to declare an integer type
|
* Obtain DBMS specific SQL code portion needed to declare an integer type
|
||||||
* field to be used in statements like CREATE TABLE.
|
* field to be used in statements like CREATE TABLE.
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Db
|
* Doctrine_Db
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Event
|
* Doctrine_Event
|
||||||
*
|
*
|
||||||
@ -63,35 +64,43 @@ class Doctrine_Event
|
|||||||
const RECORD_INSERT = 24;
|
const RECORD_INSERT = 24;
|
||||||
const RECORD_SERIALIZE = 25;
|
const RECORD_SERIALIZE = 25;
|
||||||
const RECORD_UNSERIALIZE = 26;
|
const RECORD_UNSERIALIZE = 26;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var mixed $_invoker the handler which invoked this event
|
* @var mixed $_invoker the handler which invoked this event
|
||||||
*/
|
*/
|
||||||
protected $_invoker;
|
protected $_invoker;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $_query the sql query associated with this event (if any)
|
* @var string $_query the sql query associated with this event (if any)
|
||||||
*/
|
*/
|
||||||
protected $_query;
|
protected $_query;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $_params the parameters associated with the query (if any)
|
* @var string $_params the parameters associated with the query (if any)
|
||||||
*/
|
*/
|
||||||
protected $_params;
|
protected $_params;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Doctrine_Event constants
|
* @see Doctrine_Event constants
|
||||||
* @var integer $_code the event code
|
* @var integer $_code the event code
|
||||||
*/
|
*/
|
||||||
protected $_code;
|
protected $_code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $_startedMicrotime the time point in which this event was started
|
* @var integer $_startedMicrotime the time point in which this event was started
|
||||||
*/
|
*/
|
||||||
protected $_startedMicrotime;
|
protected $_startedMicrotime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var integer $_endedMicrotime the time point in which this event was ended
|
* @var integer $_endedMicrotime the time point in which this event was ended
|
||||||
*/
|
*/
|
||||||
protected $_endedMicrotime;
|
protected $_endedMicrotime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array $_options an array of options
|
* @var array $_options an array of options
|
||||||
*/
|
*/
|
||||||
protected $_options = array();
|
protected $_options = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*
|
*
|
||||||
@ -107,6 +116,7 @@ class Doctrine_Event
|
|||||||
$this->_query = $query;
|
$this->_query = $query;
|
||||||
$this->_params = $params;
|
$this->_params = $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getQuery
|
* getQuery
|
||||||
*
|
*
|
||||||
@ -116,6 +126,7 @@ class Doctrine_Event
|
|||||||
{
|
{
|
||||||
return $this->_query;
|
return $this->_query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getName
|
* getName
|
||||||
* returns the name of this event
|
* returns the name of this event
|
||||||
@ -173,6 +184,7 @@ class Doctrine_Event
|
|||||||
return 'unserialize record';
|
return 'unserialize record';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getCode
|
* getCode
|
||||||
*
|
*
|
||||||
@ -182,6 +194,7 @@ class Doctrine_Event
|
|||||||
{
|
{
|
||||||
return $this->_code;
|
return $this->_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getOption
|
* getOption
|
||||||
* returns the value of an option
|
* returns the value of an option
|
||||||
@ -197,6 +210,7 @@ class Doctrine_Event
|
|||||||
|
|
||||||
return $this->_options[$option];
|
return $this->_options[$option];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* skipOperation
|
* skipOperation
|
||||||
* skips the next operation
|
* skips the next operation
|
||||||
@ -210,6 +224,7 @@ class Doctrine_Event
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setOption
|
* setOption
|
||||||
* sets the value of an option
|
* sets the value of an option
|
||||||
@ -224,6 +239,7 @@ class Doctrine_Event
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setOption
|
* setOption
|
||||||
* sets the value of an option by reference
|
* sets the value of an option by reference
|
||||||
@ -238,6 +254,7 @@ class Doctrine_Event
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* start
|
* start
|
||||||
* starts the internal timer of this event
|
* starts the internal timer of this event
|
||||||
@ -248,6 +265,7 @@ class Doctrine_Event
|
|||||||
{
|
{
|
||||||
$this->_startedMicrotime = microtime(true);
|
$this->_startedMicrotime = microtime(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hasEnded
|
* hasEnded
|
||||||
* whether or not this event has ended
|
* whether or not this event has ended
|
||||||
@ -258,6 +276,7 @@ class Doctrine_Event
|
|||||||
{
|
{
|
||||||
return ($this->_endedMicrotime != null);
|
return ($this->_endedMicrotime != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* end
|
* end
|
||||||
* ends the internal timer of this event
|
* ends the internal timer of this event
|
||||||
@ -270,6 +289,7 @@ class Doctrine_Event
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getInvoker
|
* getInvoker
|
||||||
* returns the handler that invoked this event
|
* returns the handler that invoked this event
|
||||||
@ -281,6 +301,7 @@ class Doctrine_Event
|
|||||||
{
|
{
|
||||||
return $this->_invoker;
|
return $this->_invoker;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getParams
|
* getParams
|
||||||
* returns the parameters of the query
|
* returns the parameters of the query
|
||||||
@ -291,6 +312,7 @@ class Doctrine_Event
|
|||||||
{
|
{
|
||||||
return $this->_params;
|
return $this->_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the elapsed time (in microseconds) that the event ran. If the event has
|
* Get the elapsed time (in microseconds) that the event ran. If the event has
|
||||||
* not yet ended, return false.
|
* not yet ended, return false.
|
||||||
|
@ -39,6 +39,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
* @var array $listeners an array containing all listeners
|
* @var array $listeners an array containing all listeners
|
||||||
*/
|
*/
|
||||||
protected $_listeners = array();
|
protected $_listeners = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add
|
* add
|
||||||
* adds a listener to the chain of listeners
|
* adds a listener to the chain of listeners
|
||||||
@ -60,6 +61,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$this->_listeners[$name] = $listener;
|
$this->_listeners[$name] = $listener;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns a Doctrine_EventListener on success
|
* returns a Doctrine_EventListener on success
|
||||||
* and null on failure
|
* and null on failure
|
||||||
@ -74,6 +76,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
}
|
}
|
||||||
return $this->_listeners[$key];
|
return $this->_listeners[$key];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set
|
* set
|
||||||
*
|
*
|
||||||
@ -85,6 +88,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
{
|
{
|
||||||
$this->_listeners[$key] = $listener;
|
$this->_listeners[$key] = $listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onLoad
|
* onLoad
|
||||||
* an event invoked when Doctrine_Record is being loaded from database
|
* an event invoked when Doctrine_Record is being loaded from database
|
||||||
@ -98,6 +102,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->onLoad($record);
|
$listener->onLoad($record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onPreLoad
|
* onPreLoad
|
||||||
* an event invoked when Doctrine_Record is being loaded
|
* an event invoked when Doctrine_Record is being loaded
|
||||||
@ -112,6 +117,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->onPreLoad($record);
|
$listener->onPreLoad($record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onSleep
|
* onSleep
|
||||||
* an event invoked when Doctrine_Record is serialized
|
* an event invoked when Doctrine_Record is serialized
|
||||||
@ -125,6 +131,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->onSleep($record);
|
$listener->onSleep($record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onWakeUp
|
* onWakeUp
|
||||||
* an event invoked when Doctrine_Record is unserialized
|
* an event invoked when Doctrine_Record is unserialized
|
||||||
@ -138,6 +145,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->onWakeUp($record);
|
$listener->onWakeUp($record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* postClose
|
* postClose
|
||||||
* an event invoked after Doctrine_Connection is closed
|
* an event invoked after Doctrine_Connection is closed
|
||||||
@ -151,6 +159,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->postClose($event);
|
$listener->postClose($event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* preClose
|
* preClose
|
||||||
* an event invoked before Doctrine_Connection is closed
|
* an event invoked before Doctrine_Connection is closed
|
||||||
@ -164,6 +173,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->preClose($event);
|
$listener->preClose($event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onOpen
|
* onOpen
|
||||||
* an event invoked after Doctrine_Connection is opened
|
* an event invoked after Doctrine_Connection is opened
|
||||||
@ -177,6 +187,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->onOpen($connection);
|
$listener->onOpen($connection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onTransactionCommit
|
* onTransactionCommit
|
||||||
* an event invoked after a Doctrine_Connection transaction is committed
|
* an event invoked after a Doctrine_Connection transaction is committed
|
||||||
@ -190,6 +201,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->postTransactionCommit($event);
|
$listener->postTransactionCommit($event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onPreTransactionCommit
|
* onPreTransactionCommit
|
||||||
* an event invoked before a Doctrine_Connection transaction is committed
|
* an event invoked before a Doctrine_Connection transaction is committed
|
||||||
@ -203,6 +215,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->preTransactionCommit($event);
|
$listener->preTransactionCommit($event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onTransactionRollback
|
* onTransactionRollback
|
||||||
* an event invoked after a Doctrine_Connection transaction is being rolled back
|
* an event invoked after a Doctrine_Connection transaction is being rolled back
|
||||||
@ -216,6 +229,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->postTransactionRollback($event);
|
$listener->postTransactionRollback($event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onPreTransactionRollback
|
* onPreTransactionRollback
|
||||||
* an event invoked before a Doctrine_Connection transaction is being rolled back
|
* an event invoked before a Doctrine_Connection transaction is being rolled back
|
||||||
@ -229,6 +243,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->preTransactionRollback($event);
|
$listener->preTransactionRollback($event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onTransactionBegin
|
* onTransactionBegin
|
||||||
* an event invoked after a Doctrine_Connection transaction has been started
|
* an event invoked after a Doctrine_Connection transaction has been started
|
||||||
@ -242,6 +257,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->postTransactionBegin($event);
|
$listener->postTransactionBegin($event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onTransactionBegin
|
* onTransactionBegin
|
||||||
* an event invoked before a Doctrine_Connection transaction is being started
|
* an event invoked before a Doctrine_Connection transaction is being started
|
||||||
@ -255,6 +271,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->preTransactionBegin($event);
|
$listener->preTransactionBegin($event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onCollectionDelete
|
* onCollectionDelete
|
||||||
* an event invoked after a Doctrine_Collection is being deleted
|
* an event invoked after a Doctrine_Collection is being deleted
|
||||||
@ -268,6 +285,7 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
|
|||||||
$listener->onCollectionDelete($collection);
|
$listener->onCollectionDelete($collection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onCollectionDelete
|
* onCollectionDelete
|
||||||
* an event invoked after a Doctrine_Collection is being deleted
|
* an event invoked after a Doctrine_Collection is being deleted
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
* and is licensed under the LGPL. For more information, see
|
* and is licensed under the LGPL. For more information, see
|
||||||
* <http://www.phpdoctrine.com>.
|
* <http://www.phpdoctrine.com>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Doctrine_Exception
|
* Doctrine_Exception
|
||||||
*
|
*
|
||||||
@ -68,6 +69,7 @@ class Doctrine_Exception extends Exception
|
|||||||
Doctrine::ERR_TRUNCATED => 'truncated',
|
Doctrine::ERR_TRUNCATED => 'truncated',
|
||||||
Doctrine::ERR_DEADLOCK => 'deadlock detected',
|
Doctrine::ERR_DEADLOCK => 'deadlock detected',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a textual error message for a Doctrine error code
|
* Return a textual error message for a Doctrine error code
|
||||||
*
|
*
|
||||||
|
@ -58,6 +58,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
$this->conn->execute($this->dropDatabaseSql($database));
|
$this->conn->execute($this->dropDatabaseSql($database));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing database
|
* drop an existing database
|
||||||
* (this method is implemented by the drivers)
|
* (this method is implemented by the drivers)
|
||||||
@ -69,6 +70,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
throw new Doctrine_Export_Exception('Drop database not supported by this driver.');
|
throw new Doctrine_Export_Exception('Drop database not supported by this driver.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dropTableSql
|
* dropTableSql
|
||||||
* drop an existing table
|
* drop an existing table
|
||||||
@ -80,6 +82,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
return 'DROP TABLE ' . $this->conn->quoteIdentifier($table);
|
return 'DROP TABLE ' . $this->conn->quoteIdentifier($table);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dropTable
|
* dropTable
|
||||||
* drop an existing table
|
* drop an existing table
|
||||||
@ -117,6 +120,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return 'DROP INDEX ' . $name;
|
return 'DROP INDEX ' . $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop existing constraint
|
* drop existing constraint
|
||||||
*
|
*
|
||||||
@ -132,6 +136,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $this->conn->exec('ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $name);
|
return $this->conn->exec('ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop existing foreign key
|
* drop existing foreign key
|
||||||
*
|
*
|
||||||
@ -143,6 +148,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
return $this->dropConstraint($table, $name);
|
return $this->dropConstraint($table, $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dropSequenceSql
|
* dropSequenceSql
|
||||||
* drop existing sequence
|
* drop existing sequence
|
||||||
@ -156,6 +162,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
$this->conn->exec($this->dropSequenceSql($sequenceName));
|
$this->conn->exec($this->dropSequenceSql($sequenceName));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dropSequenceSql
|
* dropSequenceSql
|
||||||
* drop existing sequence
|
* drop existing sequence
|
||||||
@ -168,6 +175,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
throw new Doctrine_Export_Exception('Drop sequence not supported by this driver.');
|
throw new Doctrine_Export_Exception('Drop sequence not supported by this driver.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a new database
|
* create a new database
|
||||||
* (this method is implemented by the drivers)
|
* (this method is implemented by the drivers)
|
||||||
@ -179,6 +187,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
$this->conn->execute($this->createDatabaseSql($database));
|
$this->conn->execute($this->createDatabaseSql($database));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a new database
|
* create a new database
|
||||||
* (this method is implemented by the drivers)
|
* (this method is implemented by the drivers)
|
||||||
@ -190,6 +199,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
throw new Doctrine_Export_Exception('Create database not supported by this driver.');
|
throw new Doctrine_Export_Exception('Create database not supported by this driver.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a new table
|
* create a new table
|
||||||
*
|
*
|
||||||
@ -265,6 +275,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a new table
|
* create a new table
|
||||||
*
|
*
|
||||||
@ -283,6 +294,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
$this->conn->execute($query);
|
$this->conn->execute($query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create sequence
|
* create sequence
|
||||||
*
|
*
|
||||||
@ -301,6 +313,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
return $this->conn->execute($this->createSequenceSql($seqName, $start = 1, $options));
|
return $this->conn->execute($this->createSequenceSql($seqName, $start = 1, $options));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return RDBMS specific create sequence statement
|
* return RDBMS specific create sequence statement
|
||||||
* (this method is implemented by the drivers)
|
* (this method is implemented by the drivers)
|
||||||
@ -320,6 +333,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
throw new Doctrine_Export_Exception('Create sequence not supported by this driver.');
|
throw new Doctrine_Export_Exception('Create sequence not supported by this driver.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a constraint on a table
|
* create a constraint on a table
|
||||||
*
|
*
|
||||||
@ -347,6 +361,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $this->conn->exec($sql);
|
return $this->conn->exec($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a constraint on a table
|
* create a constraint on a table
|
||||||
*
|
*
|
||||||
@ -388,6 +403,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the stucture of a field into an array
|
* Get the stucture of a field into an array
|
||||||
*
|
*
|
||||||
@ -423,6 +439,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
return $this->conn->execute($this->createIndexSql($table, $name, $definition));
|
return $this->conn->execute($this->createIndexSql($table, $name, $definition));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the stucture of a field into an array
|
* Get the stucture of a field into an array
|
||||||
*
|
*
|
||||||
@ -473,6 +490,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createForeignKey
|
* createForeignKey
|
||||||
*
|
*
|
||||||
@ -486,6 +504,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $this->conn->execute($sql);
|
return $this->conn->execute($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* alter an existing table
|
* alter an existing table
|
||||||
* (this method is implemented by the drivers)
|
* (this method is implemented by the drivers)
|
||||||
@ -583,6 +602,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
$this->conn->execute($sql);
|
$this->conn->execute($sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generates the sql for altering an existing table
|
* generates the sql for altering an existing table
|
||||||
* (this method is implemented by the drivers)
|
* (this method is implemented by the drivers)
|
||||||
@ -599,6 +619,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
throw new Doctrine_Export_Exception('Alter table not supported by this driver.');
|
throw new Doctrine_Export_Exception('Alter table not supported by this driver.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get declaration of a number of field in bulk
|
* Get declaration of a number of field in bulk
|
||||||
*
|
*
|
||||||
@ -637,6 +658,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
return implode(', ', $queryFields);
|
return implode(', ', $queryFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to declare a generic type
|
* Obtain DBMS specific SQL code portion needed to declare a generic type
|
||||||
* field to be used in statements like CREATE TABLE.
|
* field to be used in statements like CREATE TABLE.
|
||||||
@ -697,6 +719,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
return $this->conn->quoteIdentifier($name, true) . ' ' . $dec . $charset . $default . $notnull . $unique . $check . $collation;
|
return $this->conn->quoteIdentifier($name, true) . ' ' . $dec . $charset . $default . $notnull . $unique . $check . $collation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDefaultDeclaration
|
* getDefaultDeclaration
|
||||||
* Obtain DBMS specific SQL code portion needed to set a default value
|
* Obtain DBMS specific SQL code portion needed to set a default value
|
||||||
@ -726,6 +749,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to set a CHECK constraint
|
* Obtain DBMS specific SQL code portion needed to set a CHECK constraint
|
||||||
* declaration to be used in statements like CREATE TABLE.
|
* declaration to be used in statements like CREATE TABLE.
|
||||||
@ -752,6 +776,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return implode(', ', $constraints);
|
return implode(', ', $constraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to set an index
|
* Obtain DBMS specific SQL code portion needed to set an index
|
||||||
* declaration to be used in statements like CREATE TABLE.
|
* declaration to be used in statements like CREATE TABLE.
|
||||||
@ -783,6 +808,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getIndexFieldDeclarationList
|
* getIndexFieldDeclarationList
|
||||||
* Obtain DBMS specific SQL code portion needed to set an index
|
* Obtain DBMS specific SQL code portion needed to set an index
|
||||||
@ -802,6 +828,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
return implode(', ', $ret);
|
return implode(', ', $ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A method to return the required SQL string that fits between CREATE ... TABLE
|
* A method to return the required SQL string that fits between CREATE ... TABLE
|
||||||
* to create the table as a temporary table.
|
* to create the table as a temporary table.
|
||||||
@ -820,6 +847,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
return 'TEMPORARY';
|
return 'TEMPORARY';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getForeignKeyDeclaration
|
* getForeignKeyDeclaration
|
||||||
* Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint
|
* Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint
|
||||||
@ -869,6 +897,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAdvancedForeignKeyOptions
|
* getAdvancedForeignKeyOptions
|
||||||
* Return the FOREIGN KEY query section dealing with non-standard options
|
* Return the FOREIGN KEY query section dealing with non-standard options
|
||||||
@ -888,6 +917,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
}
|
}
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getForeignKeyReferentialAction
|
* getForeignKeyReferentialAction
|
||||||
*
|
*
|
||||||
@ -913,6 +943,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
throw new Doctrine_Export_Exception('Unknown foreign key referential action \'' . $upper . '\' given.');
|
throw new Doctrine_Export_Exception('Unknown foreign key referential action \'' . $upper . '\' given.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getForeignKeyBaseDeclaration
|
* getForeignKeyBaseDeclaration
|
||||||
* Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint
|
* Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint
|
||||||
@ -953,6 +984,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to set the UNIQUE constraint
|
* Obtain DBMS specific SQL code portion needed to set the UNIQUE constraint
|
||||||
* of a field declaration to be used in statements like CREATE TABLE.
|
* of a field declaration to be used in statements like CREATE TABLE.
|
||||||
@ -964,6 +996,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
return 'UNIQUE';
|
return 'UNIQUE';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
|
* Obtain DBMS specific SQL code portion needed to set the CHARACTER SET
|
||||||
* of a field declaration to be used in statements like CREATE TABLE.
|
* of a field declaration to be used in statements like CREATE TABLE.
|
||||||
@ -976,6 +1009,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to set the COLLATION
|
* Obtain DBMS specific SQL code portion needed to set the COLLATION
|
||||||
* of a field declaration to be used in statements like CREATE TABLE.
|
* of a field declaration to be used in statements like CREATE TABLE.
|
||||||
@ -988,6 +1022,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportSchema
|
* exportSchema
|
||||||
* method for exporting Doctrine_Record classes to a schema
|
* method for exporting Doctrine_Record classes to a schema
|
||||||
@ -1013,6 +1048,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
$this->exportClasses($models);
|
$this->exportClasses($models);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportClasses
|
* exportClasses
|
||||||
* method for exporting Doctrine_Record classes to a schema
|
* method for exporting Doctrine_Record classes to a schema
|
||||||
@ -1030,7 +1066,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
$connection = $record->getTable()->getConnection();
|
$connection = $record->getTable()->getConnection();
|
||||||
$connectionName = Doctrine_Manager::getInstance()->getConnectionName($connection);
|
$connectionName = Doctrine_Manager::getInstance()->getConnectionName($connection);
|
||||||
|
|
||||||
if (!isset($connections[$connectionName])) {
|
if ( ! isset($connections[$connectionName])) {
|
||||||
$connections[$connectionName] = array();
|
$connections[$connectionName] = array();
|
||||||
$connections[$connectionName]['creates'] = array();
|
$connections[$connectionName]['creates'] = array();
|
||||||
$connections[$connectionName]['alters'] = array();
|
$connections[$connectionName]['alters'] = array();
|
||||||
@ -1075,6 +1111,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
$connection->commit();
|
$connection->commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportClassesSql
|
* exportClassesSql
|
||||||
* method for exporting Doctrine_Record classes to a schema
|
* method for exporting Doctrine_Record classes to a schema
|
||||||
@ -1115,6 +1152,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportPluginsSql
|
* exportPluginsSql
|
||||||
* exports plugin tables for given table
|
* exports plugin tables for given table
|
||||||
@ -1147,6 +1185,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportSql
|
* exportSql
|
||||||
* returns the sql for exporting Doctrine_Record classes to a schema
|
* returns the sql for exporting Doctrine_Record classes to a schema
|
||||||
@ -1172,6 +1211,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
|
|
||||||
return $this->exportClassesSql($models);
|
return $this->exportClassesSql($models);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* exportTable
|
* exportTable
|
||||||
* exports given table into database based on column and option definitions
|
* exports given table into database based on column and option definitions
|
||||||
|
@ -46,6 +46,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
'PHP Interbase API does not support direct queries. You have to ' .
|
'PHP Interbase API does not support direct queries. You have to ' .
|
||||||
'create the db manually by using isql command or a similar program');
|
'create the db manually by using isql command or a similar program');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing database
|
* drop an existing database
|
||||||
*
|
*
|
||||||
@ -58,6 +59,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
'PHP Interbase API does not support direct queries. You have ' .
|
'PHP Interbase API does not support direct queries. You have ' .
|
||||||
'to drop the db manually by using isql command or a similar program');
|
'to drop the db manually by using isql command or a similar program');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add an autoincrement sequence + trigger
|
* add an autoincrement sequence + trigger
|
||||||
*
|
*
|
||||||
@ -99,6 +101,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing autoincrement sequence + trigger
|
* drop an existing autoincrement sequence + trigger
|
||||||
*
|
*
|
||||||
@ -116,6 +119,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
|
|
||||||
return $this->conn->exec("DELETE FROM RDB\$TRIGGERS WHERE UPPER(RDB\$RELATION_NAME)=" . $table . " AND UPPER(RDB\$TRIGGER_NAME)=" . $triggerName);
|
return $this->conn->exec("DELETE FROM RDB\$TRIGGERS WHERE UPPER(RDB\$RELATION_NAME)=" . $table . " AND UPPER(RDB\$TRIGGER_NAME)=" . $triggerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a new table
|
* create a new table
|
||||||
*
|
*
|
||||||
@ -167,6 +171,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if planned changes are supported
|
* Check if planned changes are supported
|
||||||
*
|
*
|
||||||
@ -196,6 +201,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing table
|
* drop an existing table
|
||||||
*
|
*
|
||||||
@ -212,6 +218,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* alter an existing table
|
* alter an existing table
|
||||||
*
|
*
|
||||||
@ -372,6 +379,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
$this->_silentCommit();
|
$this->_silentCommit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the stucture of a field into an array
|
* Get the stucture of a field into an array
|
||||||
*
|
*
|
||||||
@ -431,6 +439,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a constraint on a table
|
* create a constraint on a table
|
||||||
*
|
*
|
||||||
@ -480,6 +489,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
// TODO ? $this->_silentCommit();
|
// TODO ? $this->_silentCommit();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A method to return the required SQL string that fits between CREATE ... TABLE
|
* A method to return the required SQL string that fits between CREATE ... TABLE
|
||||||
* to create the table as a temporary table.
|
* to create the table as a temporary table.
|
||||||
@ -491,6 +501,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
{
|
{
|
||||||
return 'GLOBAL TEMPORARY';
|
return 'GLOBAL TEMPORARY';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create sequence
|
* create sequence
|
||||||
*
|
*
|
||||||
@ -523,6 +534,7 @@ class Doctrine_Export_Firebird extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
throw new Doctrine_Export_Exception('could not create sequence table');
|
throw new Doctrine_Export_Exception('could not create sequence table');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop existing sequence
|
* drop existing sequence
|
||||||
*
|
*
|
||||||
|
@ -44,6 +44,7 @@ class Doctrine_Export_Frontbase extends Doctrine_Export
|
|||||||
$name = $this->conn->quoteIdentifier($name, true);
|
$name = $this->conn->quoteIdentifier($name, true);
|
||||||
return 'CREATE DATABASE ' . $name;
|
return 'CREATE DATABASE ' . $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing database
|
* drop an existing database
|
||||||
*
|
*
|
||||||
@ -55,6 +56,7 @@ class Doctrine_Export_Frontbase extends Doctrine_Export
|
|||||||
$name = $this->conn->quoteIdentifier($name, true);
|
$name = $this->conn->quoteIdentifier($name, true);
|
||||||
return 'DELETE DATABASE ' . $name;
|
return 'DELETE DATABASE ' . $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing table
|
* drop an existing table
|
||||||
*
|
*
|
||||||
@ -67,6 +69,7 @@ class Doctrine_Export_Frontbase extends Doctrine_Export
|
|||||||
$name = $this->conn->quoteIdentifier($name, true);
|
$name = $this->conn->quoteIdentifier($name, true);
|
||||||
return 'DROP TABLE ' . $name . ' CASCADE';
|
return 'DROP TABLE ' . $name . ' CASCADE';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* alter an existing table
|
* alter an existing table
|
||||||
*
|
*
|
||||||
@ -242,6 +245,7 @@ class Doctrine_Export_Frontbase extends Doctrine_Export
|
|||||||
$name = $this->conn->quoteIdentifier($name, true);
|
$name = $this->conn->quoteIdentifier($name, true);
|
||||||
return $this->conn->exec('ALTER TABLE ' . $name . ' ' . $query);
|
return $this->conn->exec('ALTER TABLE ' . $name . ' ' . $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create sequence
|
* create sequence
|
||||||
*
|
*
|
||||||
@ -281,6 +285,7 @@ class Doctrine_Export_Frontbase extends Doctrine_Export
|
|||||||
throw new Doctrine_Export_Exception('could not create sequence table');
|
throw new Doctrine_Export_Exception('could not create sequence table');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop existing sequence
|
* drop existing sequence
|
||||||
*
|
*
|
||||||
@ -293,6 +298,7 @@ class Doctrine_Export_Frontbase extends Doctrine_Export
|
|||||||
|
|
||||||
return 'DROP TABLE ' . $sequenceName . ' CASCADE';
|
return 'DROP TABLE ' . $sequenceName . ' CASCADE';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop existing index
|
* drop existing index
|
||||||
*
|
*
|
||||||
|
@ -51,6 +51,7 @@ class Doctrine_Export_Mssql extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
return $this->conn->standaloneQuery($query, null, true);
|
return $this->conn->standaloneQuery($query, null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing database
|
* drop an existing database
|
||||||
*
|
*
|
||||||
@ -204,6 +205,7 @@ class Doctrine_Export_Mssql extends Doctrine_Export
|
|||||||
$name = $this->conn->quoteIdentifier($name, true);
|
$name = $this->conn->quoteIdentifier($name, true);
|
||||||
return $this->conn->exec('ALTER TABLE ' . $name . ' ' . $query);
|
return $this->conn->exec('ALTER TABLE ' . $name . ' ' . $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create sequence
|
* create sequence
|
||||||
*
|
*
|
||||||
@ -239,6 +241,7 @@ class Doctrine_Export_Mssql extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function drops an existing sequence
|
* This function drops an existing sequence
|
||||||
*
|
*
|
||||||
|
@ -43,6 +43,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
{
|
{
|
||||||
return 'CREATE DATABASE ' . $this->conn->quoteIdentifier($name, true);
|
return 'CREATE DATABASE ' . $this->conn->quoteIdentifier($name, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing database
|
* drop an existing database
|
||||||
*
|
*
|
||||||
@ -53,6 +54,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
{
|
{
|
||||||
return 'DROP DATABASE ' . $this->conn->quoteIdentifier($name);
|
return 'DROP DATABASE ' . $this->conn->quoteIdentifier($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a new table
|
* create a new table
|
||||||
*
|
*
|
||||||
@ -181,6 +183,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* alter an existing table
|
* alter an existing table
|
||||||
*
|
*
|
||||||
@ -360,6 +363,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
|
|
||||||
return 'ALTER TABLE ' . $name . ' ' . $query;
|
return 'ALTER TABLE ' . $name . ' ' . $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create sequence
|
* create sequence
|
||||||
*
|
*
|
||||||
@ -434,6 +438,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the stucture of a field into an array
|
* Get the stucture of a field into an array
|
||||||
*
|
*
|
||||||
@ -489,6 +494,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getDefaultDeclaration
|
* getDefaultDeclaration
|
||||||
* Obtain DBMS specific SQL code portion needed to set a default value
|
* Obtain DBMS specific SQL code portion needed to set a default value
|
||||||
@ -516,6 +522,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain DBMS specific SQL code portion needed to set an index
|
* Obtain DBMS specific SQL code portion needed to set an index
|
||||||
* declaration to be used in statements like CREATE TABLE.
|
* declaration to be used in statements like CREATE TABLE.
|
||||||
@ -552,6 +559,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getIndexFieldDeclarationList
|
* getIndexFieldDeclarationList
|
||||||
* Obtain DBMS specific SQL code portion needed to set an index
|
* Obtain DBMS specific SQL code portion needed to set an index
|
||||||
@ -589,6 +597,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
return implode(', ', $declFields);
|
return implode(', ', $declFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAdvancedForeignKeyOptions
|
* getAdvancedForeignKeyOptions
|
||||||
* Return the FOREIGN KEY query section dealing with non-standard options
|
* Return the FOREIGN KEY query section dealing with non-standard options
|
||||||
@ -611,6 +620,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop existing index
|
* drop existing index
|
||||||
*
|
*
|
||||||
@ -624,6 +634,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
|
|||||||
$name = $this->conn->quoteIdentifier($this->conn->formatter->getIndexName($name), true);
|
$name = $this->conn->quoteIdentifier($this->conn->formatter->getIndexName($name), true);
|
||||||
return 'DROP INDEX ' . $name . ' ON ' . $table;
|
return 'DROP INDEX ' . $name . ' ON ' . $table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dropTable
|
* dropTable
|
||||||
*
|
*
|
||||||
|
@ -64,6 +64,7 @@ class Doctrine_Export_Oracle extends Doctrine_Export
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing database
|
* drop an existing database
|
||||||
*
|
*
|
||||||
@ -82,6 +83,7 @@ class Doctrine_Export_Oracle extends Doctrine_Export
|
|||||||
|
|
||||||
return $this->conn->exec('DROP USER ' . $username . ' CASCADE');
|
return $this->conn->exec('DROP USER ' . $username . ' CASCADE');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add an autoincrement sequence + trigger
|
* add an autoincrement sequence + trigger
|
||||||
*
|
*
|
||||||
@ -140,6 +142,7 @@ END;
|
|||||||
';
|
';
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing autoincrement sequence + trigger
|
* drop an existing autoincrement sequence + trigger
|
||||||
*
|
*
|
||||||
@ -182,6 +185,7 @@ END;
|
|||||||
{
|
{
|
||||||
return 'GLOBAL TEMPORARY';
|
return 'GLOBAL TEMPORARY';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAdvancedForeignKeyOptions
|
* getAdvancedForeignKeyOptions
|
||||||
* Return the FOREIGN KEY query section dealing with non-standard options
|
* Return the FOREIGN KEY query section dealing with non-standard options
|
||||||
@ -296,6 +300,7 @@ END;
|
|||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing table
|
* drop an existing table
|
||||||
*
|
*
|
||||||
@ -310,6 +315,7 @@ END;
|
|||||||
//$this->conn->completeNestedTransaction();
|
//$this->conn->completeNestedTransaction();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* alter an existing table
|
* alter an existing table
|
||||||
*
|
*
|
||||||
@ -458,6 +464,7 @@ END;
|
|||||||
$result = $this->conn->exec('ALTER TABLE ' . $name . ' RENAME TO ' . $changeName);
|
$result = $this->conn->exec('ALTER TABLE ' . $name . ' RENAME TO ' . $changeName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create sequence
|
* create sequence
|
||||||
*
|
*
|
||||||
@ -478,6 +485,7 @@ END;
|
|||||||
$query .= ($start < 1 ? ' MINVALUE ' . $start : '');
|
$query .= ($start < 1 ? ' MINVALUE ' . $start : '');
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop existing sequence
|
* drop existing sequence
|
||||||
*
|
*
|
||||||
|
@ -46,6 +46,7 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
|
|||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop an existing database
|
* drop an existing database
|
||||||
*
|
*
|
||||||
@ -59,6 +60,7 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
|
|||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getAdvancedForeignKeyOptions
|
* getAdvancedForeignKeyOptions
|
||||||
* Return the FOREIGN KEY query section dealing with non-standard options
|
* Return the FOREIGN KEY query section dealing with non-standard options
|
||||||
@ -252,6 +254,7 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
|
|||||||
$this->conn->exec('ALTER TABLE ' . $name . ' RENAME TO ' . $changeName);
|
$this->conn->exec('ALTER TABLE ' . $name . ' RENAME TO ' . $changeName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return RDBMS specific create sequence statement
|
* return RDBMS specific create sequence statement
|
||||||
*
|
*
|
||||||
@ -272,6 +275,7 @@ class Doctrine_Export_Pgsql extends Doctrine_Export
|
|||||||
return $this->conn->exec('CREATE SEQUENCE ' . $sequenceName . ' INCREMENT 1' .
|
return $this->conn->exec('CREATE SEQUENCE ' . $sequenceName . ' INCREMENT 1' .
|
||||||
($start < 1 ? ' MINVALUE ' . $start : '') . ' START ' . $start);
|
($start < 1 ? ' MINVALUE ' . $start : '') . ' START ' . $start);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drop existing sequence
|
* drop existing sequence
|
||||||
*
|
*
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user