Commit 7d48c785 authored by romanb's avatar romanb

cleanup

parent 44b7e5f0
...@@ -168,6 +168,13 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable ...@@ -168,6 +168,13 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
*/ */
protected $_generatorType = self::GENERATOR_TYPE_NONE; protected $_generatorType = self::GENERATOR_TYPE_NONE;
/**
* The Id generator.
*
* @var Doctrine::ORM::Id::IdGenerator
*/
protected $_idGenerator;
/** /**
* The field mappings of the class. * The field mappings of the class.
* Keys are field names and values are mapping definitions. * Keys are field names and values are mapping definitions.
...@@ -602,6 +609,17 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable ...@@ -602,6 +609,17 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
return $this->_associationMappings; return $this->_associationMappings;
} }
/**
* Gets all association mappings of the class.
* Alias for getAssociationMappings().
*
* @return array
*/
public function getAssociations()
{
return $this->_associationMappings;
}
/** /**
* Gets the field name for a column name. * Gets the field name for a column name.
* If no field name can be found the column name is returned. * If no field name can be found the column name is returned.
...@@ -688,19 +706,6 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable ...@@ -688,19 +706,6 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
$this->_fieldMappings[$mapping['fieldName']] = $mapping; $this->_fieldMappings[$mapping['fieldName']] = $mapping;
} }
/**
* Overrides an existant field mapping.
* Used i.e. by Entity classes deriving from another Entity class that acts
* as a mapped superclass to refine the basic mapping.
*
* @param array $newMapping
* @todo Implementation.
*/
public function overrideFieldMapping(array $newMapping)
{
//...
}
/** /**
* Validates & completes the field mapping. Default values are applied here. * Validates & completes the field mapping. Default values are applied here.
* *
...@@ -757,6 +762,46 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable ...@@ -757,6 +762,46 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
return $mapping; return $mapping;
} }
/**
* @todo Implementation of Optimistic Locking.
*/
public function mapVersionField(array $mapping)
{
//...
}
/**
* Overrides an existant field mapping.
* Used i.e. by Entity classes deriving from another Entity class that acts
* as a mapped superclass to refine the basic mapping.
*
* @param array $newMapping
* @todo Implementation.
*/
public function overrideFieldMapping(array $newMapping)
{
//...
}
/**
* Used to lazily create the id generator.
*
* @param string $generatorType
* @return void
*/
protected function _createIdGenerator()
{
if ($this->_generatorType == self::GENERATOR_TYPE_IDENTITY) {
$this->_idGenerator = new Doctrine_Id_IdentityGenerator($this->_em);
} else if ($this->_generatorType == self::GENERATOR_TYPE_SEQUENCE) {
$this->_idGenerator = new Doctrine_Id_SequenceGenerator($this->_em);
} else if ($this->_generatorType == self::GENERATOR_TYPE_TABLE) {
$this->_idGenerator = new Doctrine_Id_TableGenerator($this->_em);
} else {
$this->_idGenerator = new Doctrine_Id_Assigned($this->_em);
}
}
/** /**
* Gets the default length for a column type. * Gets the default length for a column type.
* *
...@@ -1621,6 +1666,19 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable ...@@ -1621,6 +1666,19 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
return $this->_customRepositoryClassName; return $this->_customRepositoryClassName;
} }
/**
* Gets the Id generator used by the class.
*
* @return Doctrine::ORM::Id::AbstractIdGenerator
*/
public function getIdGenerator()
{
if (is_null($this->_idGenerator)) {
$this->_createIdGenerator();
}
return $this->_idGenerator;
}
/** /**
* @todo Thoughts & Implementation. * @todo Thoughts & Implementation.
*/ */
...@@ -1724,15 +1782,22 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable ...@@ -1724,15 +1782,22 @@ class Doctrine_ClassMetadata implements Doctrine_Configurable, Serializable
} }
/** /**
* Completes the identifier mapping of the class. * INTERNAL: Completes the identifier mapping of the class.
* NOTE: Should only be called by the ClassMetadataFactory! * NOTE: Should only be called by the ClassMetadataFactory!
* *
* @return void * @return void
*/ */
public function completeIdentifierMapping() public function completeIdentifierMapping()
{ {
if ($this->getIdGeneratorType() == self::GENERATOR_TYPE_AUTO) { if ($this->_generatorType == self::GENERATOR_TYPE_AUTO) {
$platform = $this->_em->getConnection()->getDatabasePlatform(); $platform = $this->_em->getConnection()->getDatabasePlatform();
if ($platform === null) {
try {
throw new Exception();
} catch (Exception $e) {
echo $e->getTraceAsString();
}
}
if ($platform->prefersSequences()) { if ($platform->prefersSequences()) {
$this->_generatorType = self::GENERATOR_TYPE_SEQUENCE; $this->_generatorType = self::GENERATOR_TYPE_SEQUENCE;
} else if ($platform->prefersIdentityColumns()) { } else if ($platform->prefersIdentityColumns()) {
......
...@@ -130,7 +130,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable, ...@@ -130,7 +130,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable,
public function __construct($entityBaseType, $keyField = null) public function __construct($entityBaseType, $keyField = null)
{ {
$this->_entityBaseType = $entityBaseType; $this->_entityBaseType = $entityBaseType;
$this->_em = Doctrine_EntityManagerFactory::getManager($entityBaseType); $this->_em = Doctrine_EntityManager::getActiveEntityManager();
if ($keyField !== null) { if ($keyField !== null) {
if ( ! $this->_em->getClassMetadata($entityBaseType)->hasField($keyField)) { if ( ! $this->_em->getClassMetadata($entityBaseType)->hasField($keyField)) {
...@@ -1018,7 +1018,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable, ...@@ -1018,7 +1018,7 @@ class Doctrine_Collection implements Countable, IteratorAggregate, Serializable,
*/ */
public function unserialize($serialized) public function unserialize($serialized)
{ {
$manager = Doctrine_EntityManagerFactory::getManager(); $manager = Doctrine_EntityManager::getActiveEntityManager();
$connection = $manager->getConnection(); $connection = $manager->getConnection();
$array = unserialize($serialized); $array = unserialize($serialized);
......
...@@ -160,13 +160,6 @@ abstract class Doctrine_Connection ...@@ -160,13 +160,6 @@ abstract class Doctrine_Connection
*/ */
protected $_transaction; protected $_transaction;
/**
* The sequence manager.
*
* @var Doctrine::DBAL::Sequencing::SequenceManager
*/
protected $_sequenceManager;
/** /**
* The schema manager. * The schema manager.
* *
...@@ -946,9 +939,9 @@ abstract class Doctrine_Connection ...@@ -946,9 +939,9 @@ abstract class Doctrine_Connection
* @param string $table Name of the table into which a new row was inserted. * @param string $table Name of the table into which a new row was inserted.
* @param string $field Name of the field into which a new row was inserted. * @param string $field Name of the field into which a new row was inserted.
*/ */
public function lastInsertId($table = null, $field = null) public function lastInsertId($seqName = null)
{ {
return $this->getSequenceManager()->lastInsertId($table, $field); return $this->_pdo->lastInsertId($seqName);
} }
/** /**
...@@ -1177,21 +1170,6 @@ abstract class Doctrine_Connection ...@@ -1177,21 +1170,6 @@ abstract class Doctrine_Connection
return Doctrine_Lib::getConnectionAsString($this); return Doctrine_Lib::getConnectionAsString($this);
} }
/**
* Gets the SequenceManager that can be used to retrieve sequence values
* through this connection.
*
* @return Doctrine::DBAL::Sequencing::SequenceManager
*/
public function getSequenceManager()
{
if ( ! $this->_sequenceManager) {
$class = "Doctrine_Sequence_" . $this->_driverName;
$this->_sequenceManager = new $class;
}
return $this->_sequenceManager;
}
/** /**
* Gets the SchemaManager that can be used to inspect or change the * Gets the SchemaManager that can be used to inspect or change the
* database schema through the connection. * database schema through the connection.
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Connection_Exception');
/**
* Doctrine_Connection_Firebird_Exception
*
* @package Doctrine
* @subpackage Connection
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver)
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
*/
class Doctrine_Connection_Firebird_Exception extends Doctrine_Connection_Exception
{
/**
* @var array $errorCodeMap an array that is used for determining portable
* error code from a native database error code
*/
protected static $errorCodeMap = array(
-104 => Doctrine::ERR_SYNTAX,
-150 => Doctrine::ERR_ACCESS_VIOLATION,
-151 => Doctrine::ERR_ACCESS_VIOLATION,
-155 => Doctrine::ERR_NOSUCHTABLE,
-157 => Doctrine::ERR_NOSUCHFIELD,
-158 => Doctrine::ERR_VALUE_COUNT_ON_ROW,
-170 => Doctrine::ERR_MISMATCH,
-171 => Doctrine::ERR_MISMATCH,
-172 => Doctrine::ERR_INVALID,
// -204 => // Covers too many errors, need to use regex on msg
-205 => Doctrine::ERR_NOSUCHFIELD,
-206 => Doctrine::ERR_NOSUCHFIELD,
-208 => Doctrine::ERR_INVALID,
-219 => Doctrine::ERR_NOSUCHTABLE,
-297 => Doctrine::ERR_CONSTRAINT,
-303 => Doctrine::ERR_INVALID,
-413 => Doctrine::ERR_INVALID_NUMBER,
-530 => Doctrine::ERR_CONSTRAINT,
-551 => Doctrine::ERR_ACCESS_VIOLATION,
-552 => Doctrine::ERR_ACCESS_VIOLATION,
// -607 => // Covers too many errors, need to use regex on msg
-625 => Doctrine::ERR_CONSTRAINT_NOT_NULL,
-803 => Doctrine::ERR_CONSTRAINT,
-804 => Doctrine::ERR_VALUE_COUNT_ON_ROW,
-904 => Doctrine::ERR_CONNECT_FAILED,
-922 => Doctrine::ERR_NOSUCHDB,
-923 => Doctrine::ERR_CONNECT_FAILED,
-924 => Doctrine::ERR_CONNECT_FAILED
);
/**
* @var array $errorRegexps an array that is used for determining portable
* error code from a native database error message
*/
protected static $errorRegexps = array(
'/generator .* is not defined/'
=> Doctrine::ERR_SYNTAX, // for compat. w ibase_errcode()
'/table.*(not exist|not found|unknown)/i'
=> Doctrine::ERR_NOSUCHTABLE,
'/table .* already exists/i'
=> Doctrine::ERR_ALREADY_EXISTS,
'/unsuccessful metadata update .* failed attempt to store duplicate value/i'
=> Doctrine::ERR_ALREADY_EXISTS,
'/unsuccessful metadata update .* not found/i'
=> Doctrine::ERR_NOT_FOUND,
'/validation error for column .* value "\*\*\* null/i'
=> Doctrine::ERR_CONSTRAINT_NOT_NULL,
'/violation of [\w ]+ constraint/i'
=> Doctrine::ERR_CONSTRAINT,
'/conversion error from string/i'
=> Doctrine::ERR_INVALID_NUMBER,
'/no permission for/i'
=> Doctrine::ERR_ACCESS_VIOLATION,
'/arithmetic exception, numeric overflow, or string truncation/i'
=> Doctrine::ERR_INVALID,
'/table unknown/i'
=> Doctrine::ERR_NOSUCHTABLE,
);
/**
* This method checks if native error code/message can be
* converted into a portable code and then adds this
* portable error code to errorInfo array and returns the modified array
*
* the portable error code is added at the end of array
*
* @param array $errorInfo error info array
* @since 1.0
* @return array
*/
public function processErrorInfo(array $errorInfo)
{
/**
// todo: are the following lines needed?
// memo for the interbase php module hackers: we need something similar
// to mysql_errno() to retrieve error codes instead of this ugly hack
if (preg_match('/^([^0-9\-]+)([0-9\-]+)\s+(.*)$/', $native_msg, $m)) {
$native_code = (int)$m[2];
} else {
$native_code = null;
}
*/
foreach (self::$errorRegexps as $regexp => $code) {
if (preg_match($regexp, $errorInfo[2])) {
$errorInfo[3] = $code;
break;
}
}
if (isset(self::$errorCodeMap[$errorInfo[1]])) {
$errorInfo[3] = self::$errorCodeMap[$errorInfo[1]];
}
return $errorInfo;
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Connection_Exception');
/**
* Doctrine_Connection_Informix_Exception
*
* @package Doctrine
* @subpackage Connection
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_Connection_Informix_Exception extends Doctrine_Connection_Exception
{ }
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
#namespace Doctrine::DBAL::Connections;
/**
* Doctrine_Connection_Mysql
*
* @package Doctrine
* @subpackage Connection
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove.
*/
class Doctrine_Connection_Mock extends Doctrine_Connection_Common
{
/**
* @var string $driverName the name of this connection driver
*/
protected $_driverName = 'Mysql';
/**
* the constructor
*
* @param Doctrine_Manager $manager
* @param PDO|Doctrine_Adapter $adapter database handler
*/
public function __construct()
{
}
public function getDatabasePlatform()
{
return new Doctrine_DatabasePlatform_MySqlPlatform();
}
public function quote($input, $type = null)
{
if ($type === 'string') {
return "'" . $input . "'";
}
return $input;
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Connection_Exception');
/**
* Doctrine_Connection_Mssql_Exception
*
* @package Doctrine
* @subpackage Connection
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @since 1.0
* @version $Revision$
* @link www.phpdoctrine.org
*/
class Doctrine_Connection_Mssql_Exception extends Doctrine_Connection_Exception
{
/**
* @var array $errorCodeMap an array that is used for determining portable
* error code from a native database error code
*/
protected static $errorCodeMap = array(
110 => Doctrine::ERR_VALUE_COUNT_ON_ROW,
155 => Doctrine::ERR_NOSUCHFIELD,
170 => Doctrine::ERR_SYNTAX,
207 => Doctrine::ERR_NOSUCHFIELD,
208 => Doctrine::ERR_NOSUCHTABLE,
245 => Doctrine::ERR_INVALID_NUMBER,
515 => Doctrine::ERR_CONSTRAINT_NOT_NULL,
547 => Doctrine::ERR_CONSTRAINT,
1913 => Doctrine::ERR_ALREADY_EXISTS,
2627 => Doctrine::ERR_CONSTRAINT,
2714 => Doctrine::ERR_ALREADY_EXISTS,
3701 => Doctrine::ERR_NOSUCHTABLE,
8134 => Doctrine::ERR_DIVZERO,
);
/**
* This method checks if native error code/message can be
* converted into a portable code and then adds this
* portable error code to $portableCode field
*
* @param array $errorInfo error info array
* @since 1.0
* @return boolean whether or not the error info processing was successfull
* (the process is successfull if portable error code was found)
*/
public function processErrorInfo(array $errorInfo)
{
$code = $errorInfo[1];
if (isset(self::$errorCodeMap[$code])) {
$this->portableCode = self::$errorCodeMap[$code];
return true;
}
return false;
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Connection_Exception');
/**
* Doctrine_Connection_Mysql_Exception
*
* @package Doctrine
* @subpackage Connection
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @since 1.0
* @version $Revision$
* @link www.phpdoctrine.org
*/
class Doctrine_Connection_Mysql_Exception extends Doctrine_Connection_Exception
{
/**
* @var array $errorCodeMap an array that is used for determining portable
* error code from a native database error code
*/
protected static $errorCodeMap = array(
1004 => Doctrine::ERR_CANNOT_CREATE,
1005 => Doctrine::ERR_CANNOT_CREATE,
1006 => Doctrine::ERR_CANNOT_CREATE,
1007 => Doctrine::ERR_ALREADY_EXISTS,
1008 => Doctrine::ERR_CANNOT_DROP,
1022 => Doctrine::ERR_ALREADY_EXISTS,
1044 => Doctrine::ERR_ACCESS_VIOLATION,
1046 => Doctrine::ERR_NODBSELECTED,
1048 => Doctrine::ERR_CONSTRAINT,
1049 => Doctrine::ERR_NOSUCHDB,
1050 => Doctrine::ERR_ALREADY_EXISTS,
1051 => Doctrine::ERR_NOSUCHTABLE,
1054 => Doctrine::ERR_NOSUCHFIELD,
1061 => Doctrine::ERR_ALREADY_EXISTS,
1062 => Doctrine::ERR_ALREADY_EXISTS,
1064 => Doctrine::ERR_SYNTAX,
1091 => Doctrine::ERR_NOT_FOUND,
1100 => Doctrine::ERR_NOT_LOCKED,
1136 => Doctrine::ERR_VALUE_COUNT_ON_ROW,
1142 => Doctrine::ERR_ACCESS_VIOLATION,
1146 => Doctrine::ERR_NOSUCHTABLE,
1216 => Doctrine::ERR_CONSTRAINT,
1217 => Doctrine::ERR_CONSTRAINT,
);
/**
* This method checks if native error code/message can be
* converted into a portable code and then adds this
* portable error code to $portableCode field
*
* @param array $errorInfo error info array
* @since 1.0
* @return boolean whether or not the error info processing was successfull
* (the process is successfull if portable error code was found)
*/
public function processErrorInfo(array $errorInfo)
{
$code = $errorInfo[1];
if (isset(self::$errorCodeMap[$code])) {
$this->portableCode = self::$errorCodeMap[$code];
return true;
}
return false;
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Connection_Exception');
/**
* Doctrine_Connection_Oracle_Exception
*
* @package Doctrine
* @subpackage Connection
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @since 1.0
* @version $Revision$
* @link www.phpdoctrine.org
*/
class Doctrine_Connection_Oracle_Exception extends Doctrine_Connection_Exception
{
/**
* @var array $errorCodeMap an array that is used for determining portable
* error code from a native database error code
*/
protected static $errorCodeMap = array(
1 => Doctrine::ERR_CONSTRAINT,
900 => Doctrine::ERR_SYNTAX,
904 => Doctrine::ERR_NOSUCHFIELD,
913 => Doctrine::ERR_VALUE_COUNT_ON_ROW,
921 => Doctrine::ERR_SYNTAX,
923 => Doctrine::ERR_SYNTAX,
942 => Doctrine::ERR_NOSUCHTABLE,
955 => Doctrine::ERR_ALREADY_EXISTS,
1400 => Doctrine::ERR_CONSTRAINT_NOT_NULL,
1401 => Doctrine::ERR_INVALID,
1407 => Doctrine::ERR_CONSTRAINT_NOT_NULL,
1418 => Doctrine::ERR_NOT_FOUND,
1476 => Doctrine::ERR_DIVZERO,
1722 => Doctrine::ERR_INVALID_NUMBER,
2289 => Doctrine::ERR_NOSUCHTABLE,
2291 => Doctrine::ERR_CONSTRAINT,
2292 => Doctrine::ERR_CONSTRAINT,
2449 => Doctrine::ERR_CONSTRAINT,
);
/**
* This method checks if native error code/message can be
* converted into a portable code and then adds this
* portable error code to $portableCode field
*
* @param array $errorInfo error info array
* @since 1.0
* @return boolean whether or not the error info processing was successfull
* (the process is successfull if portable error code was found)
*/
public function processErrorInfo(array $errorInfo)
{
$code = $errorInfo[1];
if (isset(self::$errorCodeMap[$code])) {
$this->portableCode = self::$errorCodeMap[$code];
return true;
}
return false;
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Connection_Exception');
/**
* Doctrine_Connection_Pgsql_Exception
*
* @package Doctrine
* @subpackage Connection
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Paul Cooper <pgc@ucecom.com> (PEAR MDB2 Pgsql driver)
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @since 1.0
* @version $Revision$
*/
class Doctrine_Connection_Pgsql_Exception extends Doctrine_Connection_Exception
{
/**
* @var array $errorRegexps an array that is used for determining portable
* error code from a native database error message
*/
protected static $errorRegexps = array(
'/parser: parse error at or near/i'
=> Doctrine::ERR_SYNTAX,
'/syntax error at/'
=> Doctrine::ERR_SYNTAX,
'/column reference .* is ambiguous/i'
=> Doctrine::ERR_SYNTAX,
'/column .* (of relation .*)?does not exist/i'
=> Doctrine::ERR_NOSUCHFIELD,
'/attribute .* not found|relation .* does not have attribute/i'
=> Doctrine::ERR_NOSUCHFIELD,
'/column .* specified in USING clause does not exist in (left|right) table/i'
=> Doctrine::ERR_NOSUCHFIELD,
'/(relation|sequence|table).*does not exist|class .* not found/i'
=> Doctrine::ERR_NOSUCHTABLE,
'/index .* does not exist/'
=> Doctrine::ERR_NOT_FOUND,
'/relation .* already exists/i'
=> Doctrine::ERR_ALREADY_EXISTS,
'/(divide|division) by zero$/i'
=> Doctrine::ERR_DIVZERO,
'/pg_atoi: error in .*: can\'t parse /i'
=> Doctrine::ERR_INVALID_NUMBER,
'/invalid input syntax for( type)? (integer|numeric)/i'
=> Doctrine::ERR_INVALID_NUMBER,
'/value .* is out of range for type \w*int/i'
=> Doctrine::ERR_INVALID_NUMBER,
'/integer out of range/i'
=> Doctrine::ERR_INVALID_NUMBER,
'/value too long for type character/i'
=> Doctrine::ERR_INVALID,
'/permission denied/'
=> Doctrine::ERR_ACCESS_VIOLATION,
'/violates [\w ]+ constraint/'
=> Doctrine::ERR_CONSTRAINT,
'/referential integrity violation/'
=> Doctrine::ERR_CONSTRAINT,
'/violates not-null constraint/'
=> Doctrine::ERR_CONSTRAINT_NOT_NULL,
'/more expressions than target columns/i'
=> Doctrine::ERR_VALUE_COUNT_ON_ROW,
);
/**
* This method checks if native error code/message can be
* converted into a portable code and then adds this
* portable error code to $portableCode field
*
* the portable error code is added at the end of array
*
* @param array $errorInfo error info array
* @since 1.0
* @see Doctrine::ERR_* constants
* @see Doctrine_Connection::$portableCode
* @return boolean whether or not the error info processing was successfull
* (the process is successfull if portable error code was found)
*/
public function processErrorInfo(array $errorInfo)
{
foreach (self::$errorRegexps as $regexp => $code) {
if (preg_match($regexp, $errorInfo[2])) {
$this->portableCode = $code;
return true;
}
}
return false;
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Connection_Exception');
/**
* Doctrine_Connection_Sqlite_Exception
*
* @package Doctrine
* @subpackage Connection
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @since 1.0
* @version $Revision$
* @link www.phpdoctrine.org
*/
class Doctrine_Connection_Sqlite_Exception extends Doctrine_Connection_Exception
{
/**
* @var array $errorRegexps an array that is used for determining portable
* error code from a native database error message
*/
protected static $errorRegexps = array(
'/^no such table:/' => Doctrine::ERR_NOSUCHTABLE,
'/^no such index:/' => Doctrine::ERR_NOT_FOUND,
'/^(table|index) .* already exists$/' => Doctrine::ERR_ALREADY_EXISTS,
'/PRIMARY KEY must be unique/i' => Doctrine::ERR_CONSTRAINT,
'/is not unique/' => Doctrine::ERR_CONSTRAINT,
'/columns .* are not unique/i' => Doctrine::ERR_CONSTRAINT,
'/uniqueness constraint failed/' => Doctrine::ERR_CONSTRAINT,
'/may not be NULL/' => Doctrine::ERR_CONSTRAINT_NOT_NULL,
'/^no such column:/' => Doctrine::ERR_NOSUCHFIELD,
'/column not present in both tables/i' => Doctrine::ERR_NOSUCHFIELD,
'/^near ".*": syntax error$/' => Doctrine::ERR_SYNTAX,
'/[0-9]+ values for [0-9]+ columns/i' => Doctrine::ERR_VALUE_COUNT_ON_ROW,
);
/**
* This method checks if native error code/message can be
* converted into a portable code and then adds this
* portable error code to $portableCode field
*
* @param array $errorInfo error info array
* @since 1.0
* @see Doctrine::ERR_* constants
* @see Doctrine_Connection::$portableCode
* @return boolean whether or not the error info processing was successfull
* (the process is successfull if portable error code was found)
*/
public function processErrorInfo(array $errorInfo)
{
foreach (self::$errorRegexps as $regexp => $code) {
if (preg_match($regexp, $errorInfo[2])) {
$this->portableCode = $code;
return true;
}
}
return false;
}
}
\ No newline at end of file
...@@ -182,6 +182,11 @@ class Doctrine_Connection_UnitOfWork ...@@ -182,6 +182,11 @@ class Doctrine_Connection_UnitOfWork
$this->_deletedEntities = array(); $this->_deletedEntities = array();
} }
/**
* Executes all entity insertions for entities of the specified type.
*
* @param Doctrine::ORM::Mapping::ClassMetadata $class
*/
private function _executeInserts($class) private function _executeInserts($class)
{ {
//TODO: Maybe $persister->addInsert($entity) in the loop and //TODO: Maybe $persister->addInsert($entity) in the loop and
...@@ -193,10 +198,18 @@ class Doctrine_Connection_UnitOfWork ...@@ -193,10 +198,18 @@ class Doctrine_Connection_UnitOfWork
foreach ($this->_newEntities as $entity) { foreach ($this->_newEntities as $entity) {
if ($entity->getClass()->getClassName() == $className) { if ($entity->getClass()->getClassName() == $className) {
$persister->insert($entity); $persister->insert($entity);
if ($class->isIdGeneratorIdentity()) {
$entity->_assignIdentifier($class->getIdGenerator()->getPostInsertId());
}
} }
} }
} }
/**
* Executes all entity updates for entities of the specified type.
*
* @param Doctrine::ORM::Mapping::ClassMetadata $class
*/
private function _executeUpdates($class) private function _executeUpdates($class)
{ {
$className = $class->getClassName(); $className = $class->getClassName();
...@@ -208,6 +221,11 @@ class Doctrine_Connection_UnitOfWork ...@@ -208,6 +221,11 @@ class Doctrine_Connection_UnitOfWork
} }
} }
/**
* Executes all entity deletions for entities of the specified type.
*
* @param Doctrine::ORM::Mapping::ClassMetadata $class
*/
private function _executeDeletions($class) private function _executeDeletions($class)
{ {
$className = $class->getClassName(); $className = $class->getClassName();
...@@ -224,7 +242,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -224,7 +242,7 @@ class Doctrine_Connection_UnitOfWork
* *
* @return array * @return array
*/ */
private function _getCommitOrder() private function _getCommitOrder(array $entityChangeSet = null)
{ {
//TODO: Once these 3 arrays are indexed by classname we can do this: //TODO: Once these 3 arrays are indexed by classname we can do this:
// Either way... do we need to care about duplicates? // Either way... do we need to care about duplicates?
...@@ -234,7 +252,9 @@ class Doctrine_Connection_UnitOfWork ...@@ -234,7 +252,9 @@ class Doctrine_Connection_UnitOfWork
array_keys($this->_deletedEntities) array_keys($this->_deletedEntities)
);*/ );*/
if (is_null($entityChangeSet)) {
$entityChangeSet = array_merge($this->_newEntities, $this->_dirtyEntities, $this->_deletedEntities); $entityChangeSet = array_merge($this->_newEntities, $this->_dirtyEntities, $this->_deletedEntities);
}
/* if (count($entityChangeSet) == 1) { /* if (count($entityChangeSet) == 1) {
* return array($entityChangeSet[0]->getClass()); * return array($entityChangeSet[0]->getClass());
...@@ -383,10 +403,10 @@ class Doctrine_Connection_UnitOfWork ...@@ -383,10 +403,10 @@ class Doctrine_Connection_UnitOfWork
unset($this->_newEntities[$oid]); unset($this->_newEntities[$oid]);
return; // entity has not been persisted yet, so nothing more to do. return; // entity has not been persisted yet, so nothing more to do.
} }
/* Seems unnecessary since _dirtyEntities is filled & cleared on commit, not earlier
if (isset($this->_dirtyEntities[$oid])) { if (isset($this->_dirtyEntities[$oid])) {
unset($this->_dirtyEntities[$oid]); unset($this->_dirtyEntities[$oid]);
}*/ }
if ( ! isset($this->_deletedEntities[$oid])) { if ( ! isset($this->_deletedEntities[$oid])) {
$this->_deletedEntities[$oid] = $entity; $this->_deletedEntities[$oid] = $entity;
} }
...@@ -430,7 +450,7 @@ class Doctrine_Connection_UnitOfWork ...@@ -430,7 +450,7 @@ class Doctrine_Connection_UnitOfWork
{ {
$oid = $entity->getOid(); $oid = $entity->getOid();
return isset($this->_newEntities[$oid]) || return isset($this->_newEntities[$oid]) ||
//isset($this->_dirtyEntities[$oid]) || isset($this->_dirtyEntities[$oid]) ||
isset($this->_deletedEntities[$oid]) || isset($this->_deletedEntities[$oid]) ||
$this->isInIdentityMap($entity); $this->isInIdentityMap($entity);
} }
...@@ -584,18 +604,14 @@ class Doctrine_Connection_UnitOfWork ...@@ -584,18 +604,14 @@ class Doctrine_Connection_UnitOfWork
$visited = array(); $visited = array();
$this->_doSave($entity, $visited, $insertNow); $this->_doSave($entity, $visited, $insertNow);
if ( ! empty($insertNow)) { if ( ! empty($insertNow)) {
// We have no choice. This means that there are either new entities // We have no choice. This means that there are new entities
// with an IDENTITY key generation or with a natural identifier. // with an IDENTITY column key generation.
// In both cases we must commit the inserts instantly.
//TODO: Isnt it enough to only execute the inserts instead of full flush?
$this->commit();
/* The following may be better:
$commitOrder = $this->_getCommitOrder($insertNow); $commitOrder = $this->_getCommitOrder($insertNow);
foreach ($commitOrder as $class) { foreach ($commitOrder as $class) {
$this->_executeInserts($class); $this->_executeInserts($class);
} }
//... remove them from _newEntities, or dont store them there in the first place // remove them from _newEntities
*/ $this->_newEntities = array_diff_key($this->_newEntities, $insertNow);
} }
} }
...@@ -621,22 +637,13 @@ class Doctrine_Connection_UnitOfWork ...@@ -621,22 +637,13 @@ class Doctrine_Connection_UnitOfWork
// nothing to do for $entity // nothing to do for $entity
break; break;
case Doctrine_Entity::STATE_NEW: case Doctrine_Entity::STATE_NEW:
if ($class->isIdGeneratorIdentity()) { $result = $class->getIdGenerator()->generate($entity);
$insertNow[$entity->getOid()] = $entity; if ($result == Doctrine_Id_AbstractIdGenerator::POST_INSERT_INDICATOR) {
$this->_newEntities[$entity->getOid()] = $entity;
} else if ( ! $class->usesIdGenerator()) {
$insertNow[$entity->getOid()] = $entity; $insertNow[$entity->getOid()] = $entity;
$this->_newEntities[$entity->getOid()] = $entity;
//...
} else if ($class->isIdGeneratorSequence()) {
// Get the next sequence number
//TODO: sequence name?
$id = $this->_em->getConnection()->getSequenceManager()->nextId("foo");
$entity->set($class->getSingleIdentifierFieldName(), $id);
$this->registerNew($entity);
} else { } else {
throw new Doctrine_Exception("Unable to handle ID generation of new entity."); $entity->_assignIdentifier($result);
} }
$this->registerNew($entity);
break; break;
case Doctrine_Entity::STATE_DETACHED: case Doctrine_Entity::STATE_DETACHED:
//exception? //exception?
...@@ -670,6 +677,12 @@ class Doctrine_Connection_UnitOfWork ...@@ -670,6 +677,12 @@ class Doctrine_Connection_UnitOfWork
$this->_doDelete($entity, array()); $this->_doDelete($entity, array());
} }
/**
* Enter description here...
*
* @param Doctrine_Entity $entity
* @param array $visited
*/
private function _doDelete(Doctrine_Entity $entity, array &$visited) private function _doDelete(Doctrine_Entity $entity, array &$visited)
{ {
if (isset($visited[$entity->getOid()])) { if (isset($visited[$entity->getOid()])) {
......
...@@ -45,61 +45,28 @@ class Doctrine_ConnectionFactory ...@@ -45,61 +45,28 @@ class Doctrine_ConnectionFactory
'dblib' => 'Doctrine_Connection_Mssql', 'dblib' => 'Doctrine_Connection_Mssql',
'firebird' => 'Doctrine_Connection_Firebird', 'firebird' => 'Doctrine_Connection_Firebird',
'informix' => 'Doctrine_Connection_Informix', 'informix' => 'Doctrine_Connection_Informix',
'mock' => 'Doctrine_Connection_Mock'); );
/**
* The EventManager that is injected into all created Connections.
*
* @var EventManager
*/
private $_eventManager;
/**
* The Configuration that is injected into all created Connections.
*
* @var Configuration
*/
private $_config;
public function __construct() public function __construct()
{ {
} }
/**
* Sets the Configuration that is injected into all Connections.
*
* @param Doctrine_Configuration $config
*/
public function setConfiguration(Doctrine_Configuration $config)
{
$this->_config = $config;
}
/**
* Sets the EventManager that is injected into all Connections.
*
* @param Doctrine_EventManager $eventManager
*/
public function setEventManager(Doctrine_EventManager $eventManager)
{
$this->_eventManager = $eventManager;
}
/** /**
* Creates a connection object with the specified parameters. * Creates a connection object with the specified parameters.
* *
* @param array $params * @param array $params
* @return Connection * @return Connection
*/ */
public function createConnection(array $params) public function createConnection(array $params, Doctrine_Configuration $config = null,
Doctrine_EventManager $eventManager = null)
{ {
// create default config and event manager, if not set // create default config and event manager, if not set
if ( ! $this->_config) { if ( ! $config) {
$this->_config = new Doctrine_Configuration(); $config = new Doctrine_Configuration();
} }
if ( ! $this->_eventManager) { if ( ! $eventManager) {
$this->_eventManager = new Doctrine_EventManager(); $eventManager = new Doctrine_EventManager();
} }
// check for existing pdo object // check for existing pdo object
...@@ -110,9 +77,13 @@ class Doctrine_ConnectionFactory ...@@ -110,9 +77,13 @@ class Doctrine_ConnectionFactory
} else { } else {
$this->_checkParams($params); $this->_checkParams($params);
} }
if (isset($params['driverClass'])) {
$className = $params['driverClass'];
} else {
$className = $this->_drivers[$params['driver']]; $className = $this->_drivers[$params['driver']];
}
return new $className($params, $this->_config, $this->_eventManager); return new $className($params, $config, $eventManager);
} }
/** /**
...@@ -125,14 +96,14 @@ class Doctrine_ConnectionFactory ...@@ -125,14 +96,14 @@ class Doctrine_ConnectionFactory
// check existance of mandatory parameters // check existance of mandatory parameters
// driver // driver
if ( ! isset($params['driver'])) { if ( ! isset($params['driver']) && ! isset($params['driverClass'])) {
throw Doctrine_ConnectionFactory_Exception::driverRequired(); throw Doctrine_ConnectionFactory_Exception::driverRequired();
} }
// check validity of parameters // check validity of parameters
// driver // driver
if ( ! isset($this->_drivers[$params['driver']])) { if ( isset($params['driver']) && ! isset($this->_drivers[$params['driver']])) {
throw Doctrine_ConnectionFactory_Exception::unknownDriver($driverName); throw Doctrine_ConnectionFactory_Exception::unknownDriver($driverName);
} }
} }
......
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_ConnectionFactory_Exception
*
* @package Doctrine
* @subpackage Compiler
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 2.0
* @version $Revision$
*/
class Doctrine_ConnectionFactory_Exception extends Doctrine_Exception
{
public static function userRequired()
{
return new self("The 'user' option is mandatory.");
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Exception');
/**
* Doctrine_DataDict_Exception
*
* @package Doctrine
* @subpackage DataDict
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_DataDict_Exception extends Doctrine_Exception
{ }
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage DataDict
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver)
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_DataDict_Firebird extends Doctrine_DataDict
{
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage DataDict
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove.
*/
class Doctrine_DataDict_Informix extends Doctrine_DataDict
{
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage DataDict
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @author Frank M. Kromann <frank@kromann.info> (PEAR MDB2 Mssql driver)
* @author David Coallier <davidc@php.net> (PEAR MDB2 Mssql driver)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_DataDict_Mssql extends Doctrine_DataDict
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage DataDict
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_DataDict_Mysql extends Doctrine_DataDict
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage DataDict
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_DataDict_Oracle extends Doctrine_DataDict
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage DataDict
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Paul Cooper <pgc@ucecom.com>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage DataDict
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
{
}
...@@ -246,6 +246,17 @@ class Doctrine_DatabasePlatform_FirebirdPlatform extends Doctrine_DatabasePlatfo ...@@ -246,6 +246,17 @@ class Doctrine_DatabasePlatform_FirebirdPlatform extends Doctrine_DatabasePlatfo
return 'COLLATE ' . $collation; return 'COLLATE ' . $collation;
} }
/**
* Enter description here...
*
* @param unknown_type $sequenceName
* @override
*/
public function getSequenceNextValSql($sequenceName)
{
return 'SELECT GEN_ID(' . $this->quoteIdentifier($sequenceName) . ', 1) FROM RDB$DATABASE';
}
} }
?> ?>
\ No newline at end of file
...@@ -331,6 +331,17 @@ class Doctrine_DatabasePlatform_OraclePlatform extends Doctrine_DatabasePlatform ...@@ -331,6 +331,17 @@ class Doctrine_DatabasePlatform_OraclePlatform extends Doctrine_DatabasePlatform
'unsigned' => $unsigned, 'unsigned' => $unsigned,
'fixed' => $fixed); 'fixed' => $fixed);
} }
/**
* Enter description here...
*
* @param unknown_type $sequenceName
* @override
*/
public function getSequenceNextValSql($sequenceName)
{
return 'SELECT ' . $this->quoteIdentifier($sequenceName) . '.nextval FROM DUAL';
}
} }
?> ?>
\ No newline at end of file
...@@ -204,7 +204,7 @@ abstract class Doctrine_Entity implements ArrayAccess, Serializable ...@@ -204,7 +204,7 @@ abstract class Doctrine_Entity implements ArrayAccess, Serializable
public function __construct() public function __construct()
{ {
$this->_entityName = get_class($this); $this->_entityName = get_class($this);
$this->_em = Doctrine_EntityManagerFactory::getManager($this->_entityName); $this->_em = Doctrine_EntityManager::getActiveEntityManager();
$this->_class = $this->_em->getClassMetadata($this->_entityName); $this->_class = $this->_em->getClassMetadata($this->_entityName);
$this->_oid = self::$_index++; $this->_oid = self::$_index++;
$this->_data = $this->_em->_getTmpEntityData(); $this->_data = $this->_em->_getTmpEntityData();
......
...@@ -61,6 +61,14 @@ class Doctrine_EntityManager ...@@ -61,6 +61,14 @@ class Doctrine_EntityManager
*/ */
const FLUSHMODE_MANUAL = 'manual'; const FLUSHMODE_MANUAL = 'manual';
/**
* The currently active EntityManager. Only one EntityManager can be active
* at any time.
*
* @var Doctrine::ORM::EntityManager
*/
private static $_activeEm;
/** /**
* The unique name of the EntityManager. The name is used to bind entity classes * The unique name of the EntityManager. The name is used to bind entity classes
* to certain EntityManagers. * to certain EntityManagers.
...@@ -132,16 +140,21 @@ class Doctrine_EntityManager ...@@ -132,16 +140,21 @@ class Doctrine_EntityManager
*/ */
private $_tmpEntityData = array(); private $_tmpEntityData = array();
private $_closed = false;
/** /**
* Creates a new EntityManager that operates on the given database connection. * Creates a new EntityManager that operates on the given database connection.
* *
* @param Doctrine_Connection $conn * @param Doctrine_Connection $conn
* @param string $name * @param string $name
*/ */
public function __construct(Doctrine_Connection $conn, $name = null) protected function __construct(Doctrine_Connection $conn, $name, Doctrine_Configuration $config,
Doctrine_EventManager $eventManager)
{ {
$this->_conn = $conn; $this->_conn = $conn;
$this->_name = $name; $this->_name = $name;
$this->_config = $config;
$this->_eventManager = $eventManager;
$this->_metadataFactory = new Doctrine_ClassMetadata_Factory( $this->_metadataFactory = new Doctrine_ClassMetadata_Factory(
$this, new Doctrine_ClassMetadata_CodeDriver()); $this, new Doctrine_ClassMetadata_CodeDriver());
$this->_unitOfWork = new Doctrine_Connection_UnitOfWork($this); $this->_unitOfWork = new Doctrine_Connection_UnitOfWork($this);
...@@ -158,6 +171,16 @@ class Doctrine_EntityManager ...@@ -158,6 +171,16 @@ class Doctrine_EntityManager
return $this->_conn; return $this->_conn;
} }
/**
* Gets the name of the EntityManager.
*
* @return string The name of the EntityManager.
*/
public function getName()
{
return $this->_name;
}
/** /**
* Gets the metadata for a class. Alias for getClassMetadata(). * Gets the metadata for a class. Alias for getClassMetadata().
* *
...@@ -302,6 +325,7 @@ class Doctrine_EntityManager ...@@ -302,6 +325,7 @@ class Doctrine_EntityManager
*/ */
public function flush() public function flush()
{ {
$this->_errorIfNotActiveOrClosed();
$this->_unitOfWork->commit(); $this->_unitOfWork->commit();
} }
...@@ -365,12 +389,12 @@ class Doctrine_EntityManager ...@@ -365,12 +389,12 @@ class Doctrine_EntityManager
} }
/** /**
* Releases the EntityManager. * Closes the EntityManager.
* *
*/ */
public function close() public function close()
{ {
//Doctrine_EntityManagerFactory::releaseManager($this); $this->_closed = true;
} }
/** /**
...@@ -409,6 +433,7 @@ class Doctrine_EntityManager ...@@ -409,6 +433,7 @@ class Doctrine_EntityManager
*/ */
public function save(Doctrine_Entity $entity) public function save(Doctrine_Entity $entity)
{ {
$this->_errorIfNotActiveOrClosed();
$this->_unitOfWork->save($entity); $this->_unitOfWork->save($entity);
if ($this->_flushMode == self::FLUSHMODE_IMMEDIATE) { if ($this->_flushMode == self::FLUSHMODE_IMMEDIATE) {
$this->flush(); $this->flush();
...@@ -423,6 +448,7 @@ class Doctrine_EntityManager ...@@ -423,6 +448,7 @@ class Doctrine_EntityManager
*/ */
public function delete(Doctrine_Entity $entity) public function delete(Doctrine_Entity $entity)
{ {
$this->_errorIfNotActiveOrClosed();
$this->_unitOfWork->delete($entity); $this->_unitOfWork->delete($entity);
if ($this->_flushMode == self::FLUSHMODE_IMMEDIATE) { if ($this->_flushMode == self::FLUSHMODE_IMMEDIATE) {
$this->flush(); $this->flush();
...@@ -488,6 +514,8 @@ class Doctrine_EntityManager ...@@ -488,6 +514,8 @@ class Doctrine_EntityManager
*/ */
public function createEntity($className, array $data) public function createEntity($className, array $data)
{ {
$this->_errorIfNotActiveOrClosed();
$this->_tmpEntityData = $data; $this->_tmpEntityData = $data;
$className = $this->_inferCorrectClassName($data, $className); $className = $this->_inferCorrectClassName($data, $className);
$classMetadata = $this->getClassMetadata($className); $classMetadata = $this->getClassMetadata($className);
...@@ -612,76 +640,96 @@ class Doctrine_EntityManager ...@@ -612,76 +640,96 @@ class Doctrine_EntityManager
} }
/** /**
* Sets the EventManager used by the EntityManager. * Gets the Configuration used by the EntityManager.
* *
* @param Doctrine::Common::EventManager $eventManager * @return Doctrine::Common::Configuration
* @return void
*/ */
public function setEventManager(Doctrine_EventManager $eventManager) public function getConfiguration()
{ {
$this->_eventManager = $eventManager; return $this->_config;
}
private function _errorIfNotActiveOrClosed()
{
if ( ! $this->isActive() || $this->_closed) {
throw Doctrine_EntityManagerException::notActiveOrClosed($this->_name);
}
} }
/** /**
* Sets the Configuration used by the EntityManager. * Gets the UnitOfWork used by the EntityManager to coordinate operations.
* *
* @param Doctrine::Common::Configuration $config * @return Doctrine::ORM::UnitOfWork
* @return void
*/ */
public function setConfiguration(Doctrine_Configuration $config) public function getUnitOfWork()
{ {
$this->_config = $config; return $this->_unitOfWork;
} }
/** /**
* Gets the Configuration used by the EntityManager. * Checks whether this EntityManager is the currently active one.
* *
* @return Doctrine::Common::Configuration * @return boolean
*/ */
public function getConfiguration() public function isActive()
{ {
return $this->_config; return self::$_activeEm === $this;
} }
/** /**
* Gets the UnitOfWork used by the EntityManager to coordinate operations. * Makes this EntityManager the currently active one.
* *
* @return Doctrine::ORM::UnitOfWork * @return void
*/ */
public function getUnitOfWork() public function activate()
{ {
return $this->_unitOfWork; self::$_activeEm = $this;
} }
/** /**
* Enter description here... * Factory method to create EntityManager instances.
* A newly created EntityManager is immediately activated, making it the
* currently active EntityManager.
* *
* @param unknown_type $type * @param mixed $conn An array with the connection parameters or an existing
* @param unknown_type $class * Doctrine::DBAL::Connection instance.
* @param string $name
* @param Doctrine::Common::Configuration $config The Configuration instance to use.
* @param Doctrine::Common::EventManager $eventManager The EventManager instance to use.
* @return Doctrine::ORM::EntityManager The created EntityManager.
*/ */
/*public function getIdGenerator($class) public static function create($conn, $name, Doctrine_Configuration $config = null,
Doctrine_EventManager $eventManager = null)
{ {
$type = $class->getIdGeneratorType(); if (is_array($conn)) {
if ($type == Doctrine_ClassMetadata::GENERATOR_TYPE_IDENTITY) { $connFactory = new Doctrine_ConnectionFactory();
if ( ! isset($this->_idGenerators[$type])) { $conn = $connFactory->createConnection($conn, $config, $eventManager);
$this->_idGenerators[$type] = new Doctrine_Id_IdentityGenerator($this); } else if ( ! $conn instanceof Doctrine_Connection) {
} throw new Doctrine_Exception("Invalid parameter '$conn'.");
} else if ($type == Doctrine_ClassMetadata::GENERATOR_TYPE_SEQUENCE) {
if ( ! isset($this->_idGenerators[$type])) {
$this->_idGenerators[$type] = new Doctrine_Id_SequenceGenerator($this);
} }
} else if ($type == Doctrine_ClassMetadata::GENERATOR_TYPE_TABLE) {
if ( ! isset($this->_idGenerators[$type])) { if (is_null($config)) {
$this->_idGenerators[$type] = new Doctrine_Id_TableGenerator($this); $config = new Doctrine_Configuration();
} }
if (is_null($eventManager)) {
$eventManager = new Doctrine_EventManager();
} }
$generator = $this->_idGenerators[$type]; $em = new Doctrine_EntityManager($conn, $name, $config, $eventManager);
$generator->configureForClass($class); $em->activate();
return $generator; return $em;
}*/ }
/**
* Gets the currently active EntityManager.
*
* @return Doctrine::ORM::EntityManager
*/
public static function getActiveEntityManager()
{
return self::$_activeEm;
}
} }
?> ?>
\ No newline at end of file
<?php
#namespace Doctrine::ORM;
#use Doctrine::DBAL::ConnectionFactory;
#use Doctrine::Common::Configuration;
#use Doctrine::Common::EventManager;
/**
* The EntityManagerFactory is responsible for bootstrapping EntityManager
* instances as well as keeping track of all created EntityManagers and
* hard bindings to Entities.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
class Doctrine_EntityManagerFactory
{
/**
* Map of all created EntityManagers, keys are the names.
*
* @var array
*/
private static $_ems = array();
/**
* EntityManager to Entity bindings.
*
* @var array
*/
private static $_emBindings = array();
/**
* The ConnectionFactory used to create DBAL connections.
*
* @var unknown_type
*/
private $_connFactory;
/**
* The EventManager that is injected into all created Connections
* and EntityManagers.
*
* @var EventManager
*/
private $_eventManager;
/**
* The Configuration that is injected into all creatd Connections
* and EntityManagers.
*
* @var Configuration
*/
private $_config;
/**
* Constructor.
* Creates a new EntityManagerFactory.
*/
public function __construct()
{
}
/**
* Sets the Configuration that is injected into all EntityManagers
* (and their Connections) that are created by this factory.
*
* @param Doctrine_Configuration $eventManager
*/
public function setConfiguration(Doctrine_Configuration $config)
{
$this->_config = $config;
}
/**
* Sets the EventManager that is injected into all EntityManagers
* (and their Connections) that are created by this factory.
*
* @param Doctrine_EventManager $eventManager
*/
public function setEventManager(Doctrine_EventManager $eventManager)
{
$this->_eventManager = $eventManager;
}
/**
* Creates an EntityManager.
*
* @param unknown_type $connParams
* @param unknown_type $name
* @return unknown
*/
public function createEntityManager($connParams, $name = null)
{
if ( ! $this->_connFactory) {
// Initialize connection factory
$this->_connFactory = new Doctrine_ConnectionFactory();
if ( ! $this->_config) {
$this->_config = new Doctrine_Configuration();
}
if ( ! $this->_eventManager) {
$this->_eventManager = new Doctrine_EventManager();
}
$this->_connFactory->setConfiguration($this->_config);
$this->_connFactory->setEventManager($this->_eventManager);
}
$conn = $this->_connFactory->createConnection($connParams);
$em = new Doctrine_EntityManager($conn);
$em->setEventManager($this->_eventManager);
$em->setConfiguration($this->_config);
if ($name !== null) {
self::$_ems[$name] = $em;
} else {
self::$_ems[] = $em;
}
return $em;
}
/**
* Gets the EntityManager that is responsible for the Entity.
* Static method, so that ActiveEntities can look up the right EntityManager
* without having a reference to the factory at hand.
*
* @param string $entityName
* @return EntityManager
* @throws Doctrine_EntityManager_Exception If a suitable manager can not be found.
*/
public static function getManager($entityName = null)
{
if ( ! is_null($entityName) && isset(self::$_emBindings[$entityName])) {
$emName = self::$_emBindings[$entityName];
if (isset(self::$_ems[$emName])) {
return self::$_ems[$emName];
} else {
throw Doctrine_EntityManagerFactory_Exception::noManagerWithName($emName);
}
} else if (self::$_ems) {
return current(self::$_ems);
} else {
throw Doctrine_EntityManagerFactory_Exception::noEntityManagerAvailable();
}
}
/**
* Gets the EntityManager that is responsible for the Entity.
*
* @param unknown_type $entityName
* @return unknown
*/
public function getEntityManager($entityName = null)
{
return self::getManager($entityName);
}
/**
* Binds an Entity to a specific EntityManager.
*
* @param string $entityName
* @param string $emName
*/
public function bindEntityToManager($entityName, $emName)
{
if (isset(self::$_emBindings[$entityName])) {
throw Doctrine_EntityManagerFactory_Exception::entityAlreadyBound($entityName);
}
self::$_emBindings[$entityName] = $emName;
}
/**
* Clears all bindings between Entities and EntityManagers.
*/
public function unbindAllManagers()
{
self::$_emBindings = array();
}
/**
* Releases all EntityManagers.
*
*/
public function releaseAllManagers()
{
self::unbindAllManagers();
self::$_ems = array();
}
public function releaseAllBindings()
{
self::$_emBindings = array();
}
public function releaseEntityManager($name)
{
if (isset(self::$_ems[$name])) {
unset(self::$_ems[$name]);
return true;
}
return false;
}
}
?>
\ No newline at end of file
...@@ -107,6 +107,7 @@ abstract class Doctrine_EntityPersister_Abstract ...@@ -107,6 +107,7 @@ abstract class Doctrine_EntityPersister_Abstract
//TODO: What if both join columns (local/foreign) are just db-only //TODO: What if both join columns (local/foreign) are just db-only
// columns (no fields in models) ? Currently we assume the foreign column // columns (no fields in models) ? Currently we assume the foreign column
// is mapped to a field in the foreign entity. // is mapped to a field in the foreign entity.
//TODO: throw exc if field not set
$insertData[$sourceColumn] = $new->_internalGetField( $insertData[$sourceColumn] = $new->_internalGetField(
$new->getClass()->getFieldName($targetColumn) $new->getClass()->getFieldName($targetColumn)
); );
...@@ -118,14 +119,6 @@ abstract class Doctrine_EntityPersister_Abstract ...@@ -118,14 +119,6 @@ abstract class Doctrine_EntityPersister_Abstract
//TODO: perform insert //TODO: perform insert
$this->_conn->insert($class->getTableName(), $insertData); $this->_conn->insert($class->getTableName(), $insertData);
//TODO: if IDENTITY pk, assign it
if ($class->isIdGeneratorIdentity()) {
//TODO: Postgres IDENTITY columns (SERIAL) use a sequence, so we need to pass the
// sequence name to lastInsertId().
//TODO: $this->_em->getIdGenerator($class)->generate();
$entity->_assignIdentifier($this->_conn->lastInsertId());
}
} }
/*protected function _fillJoinColumns($entity, array &$data) /*protected function _fillJoinColumns($entity, array &$data)
......
This diff is collapsed.
<?php
/*
* $Id: Exception.php 1344 2007-05-12 23:27:16Z zYne $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_EventListener_Exception
*
* @package Doctrine
* @subpackage EventListener
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision: 1344 $
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_EventListener_Exception extends Doctrine_Exception
{ }
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_EventListener_Interface');
/**
* Doctrine_EventListener all event listeners extend this base class
* the empty methods allow child classes to only implement the methods they need to implement
*
*
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @package Doctrine
* @subpackage EventListener
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
*/
interface Doctrine_EventListener_Interface
{
public function preTransactionCommit(Doctrine_Event $event);
public function postTransactionCommit(Doctrine_Event $event);
public function preTransactionRollback(Doctrine_Event $event);
public function postTransactionRollback(Doctrine_Event $event);
public function preTransactionBegin(Doctrine_Event $event);
public function postTransactionBegin(Doctrine_Event $event);
public function postConnect(Doctrine_Event $event);
public function preConnect(Doctrine_Event $event);
public function preQuery(Doctrine_Event $event);
public function postQuery(Doctrine_Event $event);
public function prePrepare(Doctrine_Event $event);
public function postPrepare(Doctrine_Event $event);
public function preExec(Doctrine_Event $event);
public function postExec(Doctrine_Event $event);
public function preError(Doctrine_Event $event);
public function postError(Doctrine_Event $event);
public function preFetch(Doctrine_Event $event);
public function postFetch(Doctrine_Event $event);
public function preFetchAll(Doctrine_Event $event);
public function postFetchAll(Doctrine_Event $event);
public function preStmtExecute(Doctrine_Event $event);
public function postStmtExecute(Doctrine_Event $event);
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Exception');
/**
* Doctrine_Export_Exception
*
* @package Doctrine
* @subpackage Export
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_Export_Exception extends Doctrine_Exception
{ }
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Export_Sqlite
*
* @package Doctrine
* @subpackage Export
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @author Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver)
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @todo Remove
*/
class Doctrine_Export_Firebird extends Doctrine_Export
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Export_Mssql
*
* @package Doctrine
* @subpackage Export
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @author Frank M. Kromann <frank@kromann.info> (PEAR MDB2 Mssql driver)
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @todo Remove
*/
class Doctrine_Export_Mssql extends Doctrine_Export
{
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Export_Mysql
*
* @package Doctrine
* @subpackage Export
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @todo Remove
*/
class Doctrine_Export_Mysql extends Doctrine_Export
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Export_Oracle
*
* @package Doctrine
* @subpackage Export
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @todo Remove.
*/
class Doctrine_Export_Oracle extends Doctrine_Export
{
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Export_Pgsql
*
* @package Doctrine
* @subpackage Export
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @todo Remove
*/
class Doctrine_Export_Pgsql extends Doctrine_Export
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Export_Sqlite
*
* @package Doctrine
* @subpackage Export
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @todo Remove
*/
class Doctrine_Export_Sqlite extends Doctrine_Export
{
}
This diff is collapsed.
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Exception');
/**
* Doctrine_Expression_Exception
*
* @package Doctrine
* @subpackage Expression
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_Expression_Exception extends Doctrine_Exception
{ }
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Expression_Firebird
*
* @package Doctrine
* @subpackage Expression
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver)
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @todo Remove
*/
class Doctrine_Expression_Firebird extends Doctrine_Expression_Driver
{
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Expression_Informix
*
* @package Doctrine
* @subpackage Expression
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Remove
*/
class Doctrine_Expression_Informix extends Doctrine_Expression
{ }
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
Doctrine::autoload('Doctrine_Connection_Module');
/**
* Doctrine_Expression_Mock
* Mock driver that is used for testing purposes
*
* @package Doctrine
* @subpackage Expression
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_Expression_Mock extends Doctrine_Expression_Driver
{ }
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Expression_Mssql
*
* @package Doctrine
* @subpackage Expression
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Remove
*/
class Doctrine_Expression_Mssql extends Doctrine_Expression_Driver
{
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Expression_Mysql
*
* @package Doctrine
* @subpackage Expression
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Remove
*/
class Doctrine_Expression_Mysql extends Doctrine_Expression_Driver
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Expression_Sqlite
*
* @package Doctrine
* @subpackage Expression
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Remove
*/
class Doctrine_Expression_Oracle extends Doctrine_Expression_Driver
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Expression_Pgsql
*
* @package Doctrine
* @subpackage Expression
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Remove
*/
class Doctrine_Expression_Pgsql extends Doctrine_Expression_Driver
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Expression_Sqlite
*
* @package Doctrine
* @subpackage Expression
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Remove
*/
class Doctrine_Expression_Sqlite extends Doctrine_Expression_Driver
{
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Hook_Equal
*
* @package Doctrine
* @subpackage Hook
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Can be removed?
* @deprecated
*/
class Doctrine_Hook_Equal extends Doctrine_Hook_Parser
{
/**
* parse
* Parses given field and field value to DQL condition
* and parameters. This method should always return
* prepared statement conditions (conditions that use
* placeholders instead of literal values).
*
* @param string $alias component alias
* @param string $field the field name
* @param mixed $value the value of the field
* @return void
*/
public function parse($alias, $field, $value)
{
$this->params = (array) $value;
$this->condition = $alias . '.' . $field . ' = ?';
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Hook_Integer
*
* @package Doctrine
* @subpackage Hook
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Can be removed?
* @deprecated
*/
class Doctrine_Hook_Integer extends Doctrine_Hook_Parser_Complex
{
/**
* parse
* Parses given field and field value to DQL condition
* and parameters. This method should always return
* prepared statement conditions (conditions that use
* placeholders instead of literal values).
*
* @param string $alias component alias
* @param string $field the field name
* @param mixed $value the value of the field
* @return void
*/
public function parseSingle($alias, $field, $value)
{
$e = explode(' ', $value);
foreach ($e as $v) {
$v = trim($v);
$e2 = explode('-', $v);
$name = $alias. '.' . $field;
if (count($e2) == 1) {
// one '-' found
$a[] = $name . ' = ?';
$this->params[] = $v;
} else {
// more than one '-' found
$a[] = '(' . $name . ' > ? AND ' . $name . ' < ?)';
$this->params += array($e2[0], $e2[1]);
}
}
return implode(' OR ', $a);
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Hook_Parser
*
* @package Doctrine
* @subpackage Hook
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Can be removed?
* @deprecated
*/
abstract class Doctrine_Hook_Parser
{
protected $condition;
protected $params = array();
public function getCondition()
{
return $this->condition;
}
/**
* getParams
* returns the parameters associated with this parser
*
* @return array
*/
public function getParams()
{
return $this->params;
}
/**
* parse
* Parses given field and field value to DQL condition
* and parameters. This method should always return
* prepared statement conditions (conditions that use
* placeholders instead of literal values).
*
* @param string $alias component alias
* @param string $field the field name
* @param mixed $value the value of the field
* @return void
*/
abstract public function parse($alias, $field, $value);
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Hook_Parser_Complex
*
* @package Doctrine
* @subpackage Hook
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Can be removed?
* @deprecated
*/
abstract class Doctrine_Hook_Parser_Complex extends Doctrine_Hook_Parser
{
protected $_tokenizer;
/**
* Constructor.
*/
public function __construct()
{
$this->_tokenizer = new Doctrine_Query_Tokenizer();
}
/**
* parse
* Parses given field and field value to DQL condition
* and parameters. This method should always return
* prepared statement conditions (conditions that use
* placeholders instead of literal values).
*
* @param string $alias component alias
* @param string $field the field name
* @param mixed $value the value of the field
* @return void
*/
public function parse($alias, $field, $value)
{
$this->condition = $this->parseClause($alias, $field, $value);
}
/**
* parseClause
*
* @param string $alias component alias
* @param string $field the field name
* @param mixed $value the value of the field
* @return void
*/
public function parseClause($alias, $field, $value)
{
$parts = $this->_tokenizer->quoteExplode($value, ' AND ');
if (count($parts) > 1) {
$ret = array();
foreach ($parts as $part) {
$ret[] = $this->parseSingle($alias, $field, $part);
}
$r = implode(' AND ', $ret);
} else {
$parts = $this->_tokenizer->quoteExplode($value, ' OR ');
if (count($parts) > 1) {
$ret = array();
foreach ($parts as $part) {
$ret[] = $this->parseClause($alias, $field, $part);
}
$r = implode(' OR ', $ret);
} else {
$ret = $this->parseSingle($alias, $field, $parts[0]);
return $ret;
}
}
return '(' . $r . ')';
}
/**
* parseSingle
*
* @param string $alias component alias
* @param string $field the field name
* @param mixed $value the value of the field
* @return void
*/
abstract public function parseSingle($alias, $field, $value);
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Hook_WordLike
*
* @package Doctrine
* @subpackage Hook
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @deprecated
* @todo Can be removed?
*/
class Doctrine_Hook_WordLike extends Doctrine_Hook_Parser_Complex
{
/**
* parse
* Parses given field and field value to DQL condition
* and parameters. This method should always return
* prepared statement conditions (conditions that use
* placeholders instead of literal values).
*
* @param string $alias component alias
* @param string $field the field name
* @param mixed $value the value of the field
* @return void
*/
public function parseSingle($alias, $field, $value)
{
if (strpos($value, "'") !== false) {
$value = $this->_tokenizer->bracketTrim($value, "'", "'");
$a[] = $alias . '.' . $field . ' LIKE ?';
$this->params[] = '%' . $value . '%';
} else {
$e2 = explode(' ',$value);
foreach ($e2 as $v) {
$v = trim($v);
$a[] = $alias . '.' . $field . ' LIKE ?';
$this->params[] = '%' . $v . '%';
}
}
return implode(' OR ', $a);
}
}
<?php <?php
#namespace Doctrine::DBAL::Id; #namespace Doctrine::ORM::Id;
/** /**
* Enter description here... * Enter description here...
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
*/ */
abstract class Doctrine_Id_AbstractIdGenerator abstract class Doctrine_Id_AbstractIdGenerator
{ {
const POST_INSERT_INDICATOR = 'POST_INSERT_INDICATOR';
protected $_em; protected $_em;
public function __construct(Doctrine_EntityManager $em) public function __construct(Doctrine_EntityManager $em)
...@@ -16,9 +18,7 @@ abstract class Doctrine_Id_AbstractIdGenerator ...@@ -16,9 +18,7 @@ abstract class Doctrine_Id_AbstractIdGenerator
$this->_em = $em; $this->_em = $em;
} }
abstract public function configureForClass(Doctrine_ClassMetadata $class); abstract public function generate(Doctrine_Entity $entity);
abstract public function generate();
} }
?> ?>
\ No newline at end of file
<?php
/**
* Special generator for application-assigned identifiers (doesnt really generate anything).
*
* @since 2.0
*/
class Doctrine_Id_Assigned extends Doctrine_Id_AbstractIdGenerator
{
/**
* Enter description here...
*
* @param Doctrine_Entity $entity
* @return unknown
* @override
*/
public function generate(Doctrine_Entity $entity)
{
if ( ! $entity->_identifier()) {
throw Doctrine_IdException::missingAssignedId($entity);
}
}
}
?>
\ No newline at end of file
...@@ -2,9 +2,21 @@ ...@@ -2,9 +2,21 @@
class Doctrine_Id_IdentityGenerator extends Doctrine_Id_AbstractIdGenerator class Doctrine_Id_IdentityGenerator extends Doctrine_Id_AbstractIdGenerator
{ {
public function generate(Doctrine_EntityManager $em) /**
* Enter description here...
*
* @param Doctrine_Entity $entity
* @return unknown
* @override
*/
public function generate(Doctrine_Entity $entity)
{ {
return self::POST_INSERT_INDICATOR;
}
public function getPostInsertId()
{
return $this->_em->getConnection()->lastInsertId();
} }
} }
......
<?php <?php
class Doctrine_Id_SequenceGenerator extends Doctrine_Id_AbstractIdGenerator
{
private $_sequenceName;
public function __construct($sequenceName)
{
$this->_sequenceName = $sequenceName;
}
/**
* Enter description here...
*
* @param Doctrine_Entity $entity
* @override
*/
public function generate(Doctrine_Entity $entity)
{
$conn = $this->_em->getConnection();
$sql = $conn->getDatabasePlatform()->getSequenceNextValSql($this->_sequenceName);
return $conn->fetchOne($sql);
}
}
?> ?>
\ No newline at end of file
<?php
class Doctrine_Id_SequenceIdentityGenerator extends Doctrine_Id_IdentityGenerator
{
private $_sequenceName;
public function __construct($sequenceName)
{
$this->_sequenceName = $sequenceName;
}
/**
* Enter description here...
*
* @param Doctrine_Connection $conn
* @override
*/
public function getPostInsertId()
{
return $this->_em->getConnection()->lastInsertId($this->_sequenceName);
}
}
?>
\ No newline at end of file
<?php <?php
/**
* Id generator that uses a single-row database table and a hi/lo algorithm.
*
* @since 2.0
*/
class Doctrine_Id_TableGenerator extends Doctrine_Id_AbstractIdGenerator
{
public function generate(Doctrine_Entity $entity)
{
throw new Exception("Not implemented");
}
}
?> ?>
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage Import
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lorenzo Alberton <l.alberton@quipo.it> (PEAR MDB2 Interbase driver)
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_Import_Firebird extends Doctrine_Import
{
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage Import
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_Import_Informix extends Doctrine_Import
{
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage Import
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @author Frank M. Kromann <frank@kromann.info> (PEAR MDB2 Mssql driver)
* @author David Coallier <davidc@php.net> (PEAR MDB2 Mssql driver)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_Import_Mssql extends Doctrine_Import
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage Import
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_Import_Mysql extends Doctrine_Import
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage Import
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_Import_Oracle extends Doctrine_Import
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage Import
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Paul Cooper <pgc@ucecom.com>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_Import_Pgsql extends Doctrine_Import
{
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* @package Doctrine
* @subpackage Import
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @version $Revision$
* @link www.phpdoctrine.org
* @since 1.0
* @todo Remove
*/
class Doctrine_Import_Sqlite extends Doctrine_Import
{
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Manager_Exception
*
* @package Doctrine
* @subpackage Manager
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_Manager_Exception extends Doctrine_Exception
{ }
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Query_Filter_Chain
*
* @package Doctrine
* @subpackage Query
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_Query_Filter_Chain
{
/**
* @var array $_filters an array of Doctrine_Query_Filter objects
*/
protected $_filters = array();
/**
* add
*
* @param Doctrine_Query_Filter $filter
* @return void
*/
public function add(Doctrine_Query_Filter $filter)
{
$this->_filters[] = $filter;
}
/**
* returns a Doctrine_Query_Filter on success
* and null on failure
*
* @param mixed $key
* @return mixed
*/
public function get($key)
{
if ( ! isset($this->_filters[$key])) {
throw new Doctrine_Query_Exception('Unknown filter ' . $key);
}
return $this->_filters[$key];
}
/**
* set
*
* @param mixed $key
* @param Doctrine_Query_Filter $listener
* @return void
*/
public function set($key, Doctrine_Query_Filter $listener)
{
$this->_filters[$key] = $listener;
}
/**
* preQuery
*
* Method for listening the preQuery method of Doctrine_Query and
* hooking into the query building procedure, doing any custom / specialized
* query building procedures that are neccessary.
*
* @return void
*/
public function preQuery(Doctrine_Query $query)
{
foreach ($this->_filters as $filter) {
$filter->preQuery($query);
}
}
/**
* postQuery
*
* Method for listening the postQuery method of Doctrine_Query and
* to hook into the query building procedure, doing any custom / specialized
* post query procedures (for example logging) that are neccessary.
*
* @return void
*/
public function postQuery(Doctrine_Query $query)
{
foreach ($this->_filters as $filter) {
$filter->postQuery($query);
}
}
}
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Query_Filter_Interface
*
* @package Doctrine
* @subpackage Query
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
interface Doctrine_Query_Filter_Interface
{
/**
* preQuery
*
* Method for listening the preQuery method of Doctrine_Query and
* hooking into the query building procedure, doing any custom / specialized
* query building procedures that are neccessary.
*
* @return void
*/
public function preQuery(Doctrine_Query $query);
/**
* postQuery
*
* Method for listening the postQuery method of Doctrine_Query and
* to hook into the query building procedure, doing any custom / specialized
* post query procedures (for example logging) that are neccessary.
*
* @return void
*/
public function postQuery(Doctrine_Query $query);
}
\ No newline at end of file
<?php
/*
* $Id: Exception.php 2702 2007-10-03 21:43:22Z Jonathan.Wage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Query_Exception
*
* @package Doctrine
* @subpackage Query
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision: 2702 $
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Remove
*/
class Doctrine_Query_Tokenizer_Exception extends Doctrine_Exception
{ }
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
#namespace Doctrine::ORM::Exceptions;
/**
* Doctrine_RawSql_Exception
*
* @package Doctrine
* @subpackage RawSql
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @todo Rename to NativeSqlException or maybe remove.
*/
class Doctrine_RawSql_Exception extends Doctrine_Exception
{ }
\ No newline at end of file
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Exception
*
* @package Doctrine
* @subpackage Record
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @deprecated Remove.
*/
class Doctrine_Record_Exception extends Doctrine_Exception
{ }
\ No newline at end of file
<?php
/*
* $Id: Record.php 1298 2007-05-01 19:26:03Z zYne $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
/**
* Doctrine_Entity_Filter
* Filters the record getters and setters
*
* @package Doctrine
* @subpackage Record
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.phpdoctrine.org
* @since 1.0
* @version $Revision: 1298 $
* @deprecated Remove.
*/
abstract class Doctrine_Record_Filter
{
protected $_table;
public function setTable(Doctrine_ClassMetadata $table)
{
$this->_table = $table;
}
public function getTable()
{
return $this->_table;
}
/**
* filterSet
* defines an implementation for filtering the set() method of Doctrine_Entity
*
* @param mixed $name name of the property or related component
*/
abstract public function filterSet(Doctrine_Entity $record, $name, $value);
/**
* filterGet
* defines an implementation for filtering the get() method of Doctrine_Entity
*
* @param mixed $name name of the property or related component
*/
abstract public function filterGet(Doctrine_Entity $record, $name);
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
* @link www.phpdoctrine.org * @link www.phpdoctrine.org
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Revision$
* @deprecated
*/ */
class Doctrine_Sequence_Db2 extends Doctrine_Sequence class Doctrine_Sequence_Db2 extends Doctrine_Sequence
{ {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
* @link www.phpdoctrine.org * @link www.phpdoctrine.org
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Revision$
* @deprecated
*/ */
class Doctrine_Sequence_Informix extends Doctrine_Sequence class Doctrine_Sequence_Informix extends Doctrine_Sequence
{ } { }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment