diff --git a/lib/Doctrine/Common/Configurable.php b/lib/Doctrine/Common/Configurable.php deleted file mode 100644 index 1725d095b0a..00000000000 --- a/lib/Doctrine/Common/Configurable.php +++ /dev/null @@ -1,39 +0,0 @@ -. - */ - -#namespace Doctrine::Common; - -/** - * Doctrine_Configurable - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.org - * @since 2.0 - * @version $Revision: 4523 $ - * @author Konsta Vesterinen - * @author Roman Borschel - */ -interface Doctrine_Common_Configurable -{ - public function getAttribute($name); - public function setAttribute($name, $value); - public function hasAttribute($name); -} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php index b8b6f2bbd4d..14fc3c046c0 100644 --- a/lib/Doctrine/DBAL/Connection.php +++ b/lib/Doctrine/DBAL/Connection.php @@ -284,7 +284,7 @@ public function delete($tableName, array $identifier) /** * Updates table row(s) with specified data * - * @throws Doctrine_Connection_Exception if something went wrong at the database level + * @throws Doctrine\DBAL\ConnectionException if something went wrong at the database level * @param string $table The table to insert data into * @param array $values An associateve array containing column-value pairs. * @return mixed boolean false if empty value array was given, @@ -509,7 +509,7 @@ public function select($query, $limit = 0, $offset = 0) * @param string $query sql query * @param array $params query parameters * - * @return PDOStatement|Doctrine_Adapter_Statement + * @return PDOStatement */ public function execute($query, array $params = array()) { @@ -536,7 +536,7 @@ public function execute($query, array $params = array()) * @param string $query sql query * @param array $params query parameters * - * @return PDOStatement|Doctrine_Adapter_Statement + * @return PDOStatement * @todo Rename to executeUpdate(). */ public function exec($query, array $params = array()) { @@ -562,7 +562,7 @@ public function exec($query, array $params = array()) { /** * Wraps the given exception into a driver-specific exception and rethrows it. * - * @throws Doctrine_Connection_Exception + * @throws Doctrine\DBAL\ConnectionException */ public function rethrowException(Exception $e, $invoker) { @@ -711,7 +711,7 @@ public function commit() * eventlistener methods * * @param string $savepoint Name of a savepoint to rollback to. - * @throws Doctrine_Transaction_Exception If the rollback operation fails at database level. + * @throws Doctrine\DBAL\ConnectionException If the rollback operation fails at database level. * @return boolean FALSE if rollback couldn't be performed, TRUE otherwise. */ public function rollback() @@ -772,4 +772,4 @@ public function getSchemaManager() } return $this->_schemaManager; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Driver.php b/lib/Doctrine/DBAL/Driver.php index 66e757c7e6b..9ba47418264 100644 --- a/lib/Doctrine/DBAL/Driver.php +++ b/lib/Doctrine/DBAL/Driver.php @@ -20,7 +20,7 @@ interface Driver * @return Doctrine::DBAL::Connection The database connection. */ public function connect(array $params, $username = null, $password = null, array $driverOptions = array()); - + /** * Gets the DatabasePlatform instance that provides all the metadata about * the platform this driver connects to. @@ -28,7 +28,7 @@ public function connect(array $params, $username = null, $password = null, array * @return Doctrine::DBAL::DatabasePlatform The database platform. */ public function getDatabasePlatform(); - + /** * Gets the SchemaManager that can be used to inspect and change the underlying * database schema of the platform this driver connects to. @@ -36,5 +36,4 @@ public function getDatabasePlatform(); * @return Doctrine\DBAL\SchemaManager */ public function getSchemaManager(Connection $conn); -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Driver/PDOConnection.php b/lib/Doctrine/DBAL/Driver/PDOConnection.php index 4a71429bfff..cf9cd41ad87 100644 --- a/lib/Doctrine/DBAL/Driver/PDOConnection.php +++ b/lib/Doctrine/DBAL/Driver/PDOConnection.php @@ -19,4 +19,4 @@ public function __construct($dsn, $user = null, $password = null, array $options $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Driver/PDOMsSql/Connection.php b/lib/Doctrine/DBAL/Driver/PDOMsSql/Connection.php index 90c2b79b3aa..c65126d6a52 100644 --- a/lib/Doctrine/DBAL/Driver/PDOMsSql/Connection.php +++ b/lib/Doctrine/DBAL/Driver/PDOMsSql/Connection.php @@ -7,7 +7,7 @@ * * @since 2.0 */ -class Connection extends PDO implements \Doctrine\DBAL\Driver\Connection +class Connection extends PDO implements \Doctrine\DBAL\Driver\PDOConnection { /** * Performs the rollback. @@ -18,7 +18,7 @@ public function rollback() { $this->exec('ROLLBACK TRANSACTION'); } - + /** * Performs the commit. * @@ -28,7 +28,7 @@ public function commit() { $this->exec('COMMIT TRANSACTION'); } - + /** * Begins a database transaction. * @@ -38,5 +38,4 @@ public function beginTransaction() { $this->exec('BEGIN TRANSACTION'); } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Driver/PDOMsSql/Driver.php b/lib/Doctrine/DBAL/Driver/PDOMsSql/Driver.php index 8ce0294f588..96410c6685e 100644 --- a/lib/Doctrine/DBAL/Driver/PDOMsSql/Driver.php +++ b/lib/Doctrine/DBAL/Driver/PDOMsSql/Driver.php @@ -4,16 +4,16 @@ class Driver implements \Doctrine\DBAL\Driver { - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) { return new Connection( - $this->_constructPdoDsn($params), - $username, - $password, - $driverOptions); + $this->_constructPdoDsn($params), + $username, + $password, + $driverOptions + ); } - + /** * Constructs the MySql PDO DSN. * @@ -25,16 +25,14 @@ private function _constructPdoDsn(array $params) { //TODO } - + public function getDatabasePlatform() { - return new Doctrine_DatabasePlatform_MySqlPlatform(); + return new \Doctrine\DBAL\Platforms\MsSqlPlatform(); } - - public function getSchemaManager(Doctrine_Connection $conn) + + public function getSchemaManager(\Doctrine\DBAL\Connection $conn) { - return new Doctrine_Schema_MySqlSchemaManager($conn); + return new \Doctrine\DBAL\Schema\MsSqlSchemaManager($conn); } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php b/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php index e49024a0a50..a89061ff5d8 100644 --- a/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php +++ b/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php @@ -40,14 +40,15 @@ class Driver implements \Doctrine\DBAL\Driver public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) { $conn = new \Doctrine\DBAL\Driver\PDOConnection( - $this->_constructPdoDsn($params), - $username, - $password, - $driverOptions); + $this->_constructPdoDsn($params), + $username, + $password, + $driverOptions + ); $conn->setAttribute(\PDO::ATTR_AUTOCOMMIT, false); return $conn; } - + /** * Constructs the MySql PDO DSN. * @@ -73,16 +74,14 @@ private function _constructPdoDsn(array $params) return $dsn; } - + public function getDatabasePlatform() { return new \Doctrine\DBAL\Platforms\MySqlPlatform(); } - + public function getSchemaManager(\Doctrine\DBAL\Connection $conn) { return new \Doctrine\DBAL\Schema\MySqlSchemaManager($conn); } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php b/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php index 5b0b68a381b..165f0293fd2 100644 --- a/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php +++ b/lib/Doctrine/DBAL/Driver/PDOOracle/Driver.php @@ -2,18 +2,20 @@ namespace Doctrine\DBAL\Driver\PDOOracle; +use Doctrine\DBAL\Platforms; + class Driver implements \Doctrine\DBAL\Driver { - public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) { return new \Doctrine\DBAL\Driver\PDOConnection( - $this->_constructPdoDsn($params), - $username, - $password, - $driverOptions); + $this->_constructPdoDsn($params), + $username, + $password, + $driverOptions + ); } - + /** * Constructs the Oracle PDO DSN. * @@ -23,16 +25,14 @@ private function _constructPdoDsn(array $params) { //TODO } - + public function getDatabasePlatform() { return new \Doctrine\DBAL\Platforms\OraclePlatform(); } - + public function getSchemaManager(\Doctrine\DBAL\Connection $conn) { return new \Doctrine\DBAL\Schema\OracleSchemaManager($conn); } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php b/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php index ac475b4153a..e383e206761 100644 --- a/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php +++ b/lib/Doctrine/DBAL/Driver/PDOPgSql/Driver.php @@ -1,24 +1,26 @@ _constructPdoDsn($params), - $username, - $password, - $driverOptions); + return new \Doctrine\DBAL\Driver\PDOConnection( + $this->_constructPdoDsn($params), + $username, + $password, + $driverOptions + ); } - + /** * Constructs the Postgres PDO DSN. * @@ -28,17 +30,14 @@ private function _constructPdoDsn(array $params) { //TODO } - + public function getDatabasePlatform() { - return new Doctrine_DBAL_Platforms_PostgreSqlPlatform(); + return new \Doctrine\DBAL\Platforms\PostgreSqlPlatform(); } - - public function getSchemaManager(Doctrine_DBAL_Connection $conn) + + public function getSchemaManager(\Doctrine\DBAL\Connection $conn) { - return new Doctrine_DBAL_Schema_PostgreSqlSchemaManager($conn); + return new \Doctrine\DBAL\Schema\PostgreSqlSchemaManager($conn); } - -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php b/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php index 9afaf0205d7..b6eceb8317e 100644 --- a/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php +++ b/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php @@ -2,8 +2,6 @@ namespace Doctrine\DBAL\Driver\PDOSqlite; -#use Doctrine::DBAL::Driver; - /** * The PDO Sqlite driver. * @@ -23,12 +21,13 @@ class Driver implements \Doctrine\DBAL\Driver public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) { return new \Doctrine\DBAL\Driver\PDOConnection( - $this->_constructPdoDsn($params), - $username, - $password, - $driverOptions); + $this->_constructPdoDsn($params), + $username, + $password, + $driverOptions + ); } - + /** * Constructs the Sqlite PDO DSN. * @@ -46,7 +45,7 @@ protected function _constructPdoDsn(array $params) return $dsn; } - + /** * Gets the database platform that is relevant for this driver. */ @@ -54,7 +53,7 @@ public function getDatabasePlatform() { return new \Doctrine\DBAL\Platforms\SqlitePlatform(); } - + /** * Gets the schema manager that is relevant for this driver. * @@ -65,7 +64,4 @@ public function getSchemaManager(\Doctrine\DBAL\Connection $conn) { return new \Doctrine\DBAL\Schema\SqliteSchemaManager($conn); } - -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Driver/PDOStatement.php b/lib/Doctrine/DBAL/Driver/PDOStatement.php index f628a1ec156..f91a211c7dd 100644 --- a/lib/Doctrine/DBAL/Driver/PDOStatement.php +++ b/lib/Doctrine/DBAL/Driver/PDOStatement.php @@ -5,4 +5,4 @@ class PDOStatement extends \PDOStatement implements \Doctrine\DBAL\Driver\Statement { private function __construct() {} -} +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Driver/Statement.php b/lib/Doctrine/DBAL/Driver/Statement.php index a7ba010d3a7..f65117efdde 100644 --- a/lib/Doctrine/DBAL/Driver/Statement.php +++ b/lib/Doctrine/DBAL/Driver/Statement.php @@ -67,9 +67,9 @@ public function bindValue($param, $value, $type = null); /** * bindParam * Binds a PHP variable to a corresponding named or question mark placeholder in the - * SQL statement that was use to prepare the statement. Unlike Doctrine_Adapter_Statement_Interface->bindValue(), + * SQL statement that was use to prepare the statement. Unlike PDOStatement->bindValue(), * the variable is bound as a reference and will only be evaluated at the time - * that Doctrine_Adapter_Statement_Interface->execute() is called. + * that PDOStatement->execute() is called. * * Most parameters are input parameters, that is, parameters that are * used in a read-only fashion to build up the query. Some drivers support the invocation @@ -106,7 +106,7 @@ public function closeCursor(); * Returns the number of columns in the result set * * @return integer Returns the number of columns in the result set represented - * by the Doctrine_Adapter_Statement_Interface object. If there is no result set, + * by the PDOStatement object. If there is no result set, * this method should return 0. */ public function columnCount(); @@ -157,18 +157,18 @@ public function execute($params = null); * this value determines which row will be returned to the caller. * This value must be one of the Query::HYDRATE_ORI_* constants, defaulting to * Query::HYDRATE_ORI_NEXT. To request a scrollable cursor for your - * Doctrine_Adapter_Statement_Interface object, + * PDOStatement object, * you must set the PDO::ATTR_CURSOR attribute to Doctrine::CURSOR_SCROLL when you * prepare the SQL statement with Doctrine_Adapter_Interface->prepare(). * - * @param integer $cursorOffset For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for which the + * @param integer $cursorOffset For a PDOStatement object representing a scrollable cursor for which the * $cursorOrientation parameter is set to Query::HYDRATE_ORI_ABS, this value specifies * the absolute number of the row in the result set that shall be fetched. * - * For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for + * For a PDOStatement object representing a scrollable cursor for * which the $cursorOrientation parameter is set to Query::HYDRATE_ORI_REL, this value * specifies the row to fetch relative to the cursor position before - * Doctrine_Adapter_Statement_Interface->fetch() was called. + * PDOStatement->fetch() was called. * * @return mixed */ @@ -197,7 +197,7 @@ public function fetchAll($fetchStyle = Query::HYDRATE_BOTH); * result set or FALSE if there are no more rows. * * @param integer $columnIndex 0-indexed number of the column you wish to retrieve from the row. If no - * value is supplied, Doctrine_Adapter_Statement_Interface->fetchColumn() + * value is supplied, PDOStatement->fetchColumn() * fetches the first column. * * @return string returns a single column in the next row of a result set. @@ -209,7 +209,7 @@ public function fetchColumn($columnIndex = 0); * Fetches the next row and returns it as an object. * * Fetches the next row and returns it as an object. This function is an alternative to - * Doctrine_Adapter_Statement_Interface->fetch() with Query::HYDRATE_CLASS or Query::HYDRATE_OBJ style. + * PDOStatement->fetch() with Query::HYDRATE_CLASS or Query::HYDRATE_OBJ style. * * @param string $className Name of the created class, defaults to stdClass. * @param array $args Elements of this array are passed to the constructor. @@ -292,4 +292,4 @@ public function setAttribute($attribute, $value); * @return boolean Returns 1 on success or FALSE on failure. */ public function setFetchMode($mode, $arg1); -} +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/DriverManager.php b/lib/Doctrine/DBAL/DriverManager.php index ad7d988f4a9..393feda494b 100644 --- a/lib/Doctrine/DBAL/DriverManager.php +++ b/lib/Doctrine/DBAL/DriverManager.php @@ -48,7 +48,7 @@ final class DriverManager /** Private constructor. This class cannot be instantiated. */ private function __construct() {} - + /** * Creates a connection object based on the specified parameters. * This method returns a Doctrine\DBAL\Connection which wraps the underlying @@ -128,7 +128,7 @@ public static function getConnection(array $params, return new $wrapperClass($params, $driver, $config, $eventManager); } - + /** * Checks the list of parameters. * @@ -150,5 +150,4 @@ private static function _checkParams(array $params) throw Exceptions\DBALException::unknownDriver($params['driver']); } } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index 785bc0c3709..68ea213b1e7 100644 --- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -1953,6 +1953,4 @@ public function getIdentityColumnNullInsertSql() * @params array $field */ abstract public function getVarcharDeclarationSql(array $field); -} - - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/Db2Platform.php b/lib/Doctrine/DBAL/Platforms/Db2Platform.php index 5d11caff89f..f088703385e 100644 --- a/lib/Doctrine/DBAL/Platforms/Db2Platform.php +++ b/lib/Doctrine/DBAL/Platforms/Db2Platform.php @@ -4,11 +4,8 @@ class Db2Platform extends AbstractPlatform { - public function getSequenceNextValSql($sequenceName) { return 'SELECT NEXTVAL FOR ' . $this->quoteIdentifier($sequenceName) . ' FROM SYSIBM.SYSDUMMY1'; } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/FirebirdPlatform.php b/lib/Doctrine/DBAL/Platforms/FirebirdPlatform.php index 71326d0fa9e..72ab193d3e3 100644 --- a/lib/Doctrine/DBAL/Platforms/FirebirdPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/FirebirdPlatform.php @@ -9,7 +9,6 @@ */ class FirebirdPlatform extends AbstractPlatform { - /** * Constructor. */ @@ -289,7 +288,4 @@ public function getSetTransactionIsolationSql($level) { return 'SET TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSql($level); } - -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/InformixPlatform.php b/lib/Doctrine/DBAL/Platforms/InformixPlatform.php index 6aed01eb2f3..4a3c99c270c 100644 --- a/lib/Doctrine/DBAL/Platforms/InformixPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/InformixPlatform.php @@ -9,7 +9,6 @@ */ class InformixPlatform extends AbstractPlatform { - public function __construct() { parent::__construct(); @@ -92,7 +91,4 @@ public function getNativeDeclaration($field) } throw \Doctrine\Common\DoctrineException::updateMe('Unknown field type \'' . $field['type'] . '\'.'); } - -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/MockPlatform.php b/lib/Doctrine/DBAL/Platforms/MockPlatform.php index 76b9c570622..a0252d7defc 100644 --- a/lib/Doctrine/DBAL/Platforms/MockPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MockPlatform.php @@ -5,5 +5,4 @@ class MockPlatform extends AbstractPlatform { public function getNativeDeclaration(array $field) {} public function getPortableDeclaration(array $field) {} -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php index acb97bdc5a9..bec56df70d6 100644 --- a/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php @@ -322,6 +322,4 @@ public function getSetTransactionIsolationSql($level) return 'SET TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSql($level); } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php index 74bbef1d955..9b8545c3328 100644 --- a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php @@ -1259,6 +1259,4 @@ public function getSetTransactionIsolationSql($level) { return 'SET SESSION TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSql($level); } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index 6837ae14034..483e36a6e23 100644 --- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -375,6 +375,4 @@ protected function _getTransactionIsolationLevelSql($level) return parent::_getTransactionIsolationLevelSql($level); } } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index 3fcac3cc73b..b1fbb35125b 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -833,7 +833,7 @@ public function getAlterTableSql($name, array $changes, $check = false) /** * return RDBMS specific create sequence statement * - * @throws Doctrine_Connection_Exception if something fails at database level + * @throws Doctrine\DBAL\ConnectionException if something fails at database level * @param string $seqName name of the sequence to be created * @param string $start start value of the sequence; default is 1 * @param array $options An associative array of table options: @@ -1001,6 +1001,4 @@ public function getSetTransactionIsolationSql($level) return 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSql($level); } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php index 43131e44cab..8a3a0cc7453 100644 --- a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php @@ -29,7 +29,6 @@ */ class SqlitePlatform extends AbstractPlatform { - /** * the constructor */ @@ -564,5 +563,4 @@ public function supportsForeignKeyConstraints() { return false; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php index d27b19c7a83..760c7dd4049 100644 --- a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php @@ -228,7 +228,7 @@ public function dropForeignKey($table, $name) * drop existing sequence * (this method is implemented by the drivers) * - * @throws Doctrine_Connection_Exception if something fails at database level + * @throws Doctrine\DBAL\ConnectionException if something fails at database level * @param string $sequenceName name of the sequence to be dropped * @return void */ @@ -285,7 +285,7 @@ public function createTable($name, array $columns, array $options = array()) /** * create sequence * - * @throws Doctrine_Connection_Exception if something fails at database level + * @throws Doctrine\DBAL\ConnectionException if something fails at database level * @param string $seqName name of the sequence to be created * @param string $start start value of the sequence; default is 1 * @param array $options An associative array of table options: @@ -476,6 +476,4 @@ public function alterTable($name, array $changes, $check = false) $this->_conn->execute($sql); } } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Schema/FirebirdSchemaManager.php b/lib/Doctrine/DBAL/Schema/FirebirdSchemaManager.php index db721c27e54..9b8726edd5d 100644 --- a/lib/Doctrine/DBAL/Schema/FirebirdSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/FirebirdSchemaManager.php @@ -614,10 +614,10 @@ public function createSequence($seqName, $start = 1, array $options = array()) $this->_conn->exec('SET GENERATOR ' . $sequenceName . ' TO ' . ($start-1)); return true; - } catch (Doctrine_Connection_Exception $e) { + } catch (Doctrine\DBAL\ConnectionException $e) { try { $this->dropSequence($seqName); - } catch(Doctrine_Connection_Exception $e) { + } catch(Doctrine\DBAL\ConnectionException $e) { throw \Doctrine\Common\DoctrineException::updateMe('Could not drop inconsistent sequence table'); } } @@ -638,7 +638,4 @@ public function dropSequenceSql($seqName) return $query; } - -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Schema/InformixSchemaManager.php b/lib/Doctrine/DBAL/Schema/InformixSchemaManager.php index df117954881..d7e158d4fdc 100644 --- a/lib/Doctrine/DBAL/Schema/InformixSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/InformixSchemaManager.php @@ -34,28 +34,23 @@ class InformixSchemaManager extends AbstractSchemaManager { protected $sql = array( - 'listTables' => "SELECT tabname,tabtype FROM systables WHERE tabtype IN ('T','V') AND owner != 'informix'", - 'listColumns' => "SELECT c.colname, c.coltype, c.collength, d.default, c.colno - FROM syscolumns c, systables t,outer sysdefaults d - WHERE c.tabid = t.tabid AND d.tabid = t.tabid AND d.colno = c.colno - AND tabname='%s' ORDER BY c.colno", - 'listPk' => "SELECT part1, part2, part3, part4, part5, part6, part7, part8 FROM - systables t, sysconstraints s, sysindexes i WHERE t.tabname='%s' - AND s.tabid=t.tabid AND s.constrtype='P' - AND i.idxname=s.idxname", - 'listForeignKeys' => "SELECT tr.tabname,updrule,delrule, - i.part1 o1,i2.part1 d1,i.part2 o2,i2.part2 d2,i.part3 o3,i2.part3 d3,i.part4 o4,i2.part4 d4, - i.part5 o5,i2.part5 d5,i.part6 o6,i2.part6 d6,i.part7 o7,i2.part7 d7,i.part8 o8,i2.part8 d8 - from systables t,sysconstraints s,sysindexes i, - sysreferences r,systables tr,sysconstraints s2,sysindexes i2 - where t.tabname='%s' - and s.tabid=t.tabid and s.constrtype='R' and r.constrid=s.constrid - and i.idxname=s.idxname and tr.tabid=r.ptabid - and s2.constrid=r.primary and i2.idxname=s2.idxname", - ); - - - - -} - + 'listTables' => "SELECT tabname,tabtype FROM systables WHERE tabtype IN ('T','V') AND owner != 'informix'", + 'listColumns' => "SELECT c.colname, c.coltype, c.collength, d.default, c.colno + FROM syscolumns c, systables t,outer sysdefaults d + WHERE c.tabid = t.tabid AND d.tabid = t.tabid AND d.colno = c.colno + AND tabname='%s' ORDER BY c.colno", + 'listPk' => "SELECT part1, part2, part3, part4, part5, part6, part7, part8 FROM + systables t, sysconstraints s, sysindexes i WHERE t.tabname='%s' + AND s.tabid=t.tabid AND s.constrtype='P' + AND i.idxname=s.idxname", + 'listForeignKeys' => "SELECT tr.tabname,updrule,delrule, + i.part1 o1,i2.part1 d1,i.part2 o2,i2.part2 d2,i.part3 o3,i2.part3 d3,i.part4 o4,i2.part4 d4, + i.part5 o5,i2.part5 d5,i.part6 o6,i2.part6 d6,i.part7 o7,i2.part7 d7,i.part8 o8,i2.part8 d8 + from systables t,sysconstraints s,sysindexes i, + sysreferences r,systables tr,sysconstraints s2,sysindexes i2 + where t.tabname='%s' + and s.tabid=t.tabid and s.constrtype='R' and r.constrid=s.constrid + and i.idxname=s.idxname and tr.tabid=r.ptabid + and s2.constrid=r.primary and i2.idxname=s2.idxname", + ); +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Schema/MsSqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/MsSqlSchemaManager.php index 48ec295e870..de79eed645f 100644 --- a/lib/Doctrine/DBAL/Schema/MsSqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/MsSqlSchemaManager.php @@ -417,7 +417,4 @@ public function listViews($database = null) return $this->conn->fetchColumn($query); } - -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php index 49028b5a241..71c2554c69e 100644 --- a/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php @@ -279,7 +279,7 @@ public function createSequence($sequenceName, $start = 1, array $options = array } $res = $this->_conn->exec($query); - } catch(Doctrine_Connection_Exception $e) { + } catch(Doctrine\DBAL\ConnectionException $e) { throw \Doctrine\Common\DoctrineException::updateMe('could not create sequence table'); } @@ -295,7 +295,7 @@ public function createSequence($sequenceName, $start = 1, array $options = array // Handle error try { $res = $this->_conn->exec('DROP TABLE ' . $sequenceName); - } catch(Doctrine_Connection_Exception $e) { + } catch(Doctrine\DBAL\ConnectionException $e) { throw \Doctrine\Common\DoctrineException::updateMe('could not drop inconsistent sequence table'); } @@ -316,7 +316,4 @@ public function dropForeignKey($table, $name) $name = $this->_conn->quoteIdentifier($name); return $this->_conn->exec('ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $name); } - -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php index c9f9f15677a..5724c6c9ac9 100644 --- a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php @@ -704,7 +704,4 @@ public function listViews($database = null) $query = 'SELECT view_name FROM sys.user_views'; return $this->_conn->fetchColumn($query); } - -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php index cb5c5fcc7e1..6e734bf0545 100644 --- a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php @@ -118,7 +118,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager * @param boolean $check indicates whether the function should just check if the DBMS driver * can perform the requested table alterations if the value is true or * actually perform them otherwise. - * @throws Doctrine_Connection_Exception + * @throws Doctrine\DBAL\ConnectionException * @return boolean */ public function alterTable($name, array $changes, $check = false) @@ -260,6 +260,4 @@ public function listTableViews($table) { return $this->_conn->fetchColumn($query); } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php index be50efda1fb..f0e952d613a 100644 --- a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php @@ -428,12 +428,12 @@ public function createSequence($seqName, $start = 1, array $options = array()) try { $this->_conn->exec('INSERT INTO ' . $sequenceName . ' (' . $seqcolName . ') VALUES (' . ($start-1) . ')'); return true; - } catch(Doctrine_Connection_Exception $e) { + } catch(Doctrine\DBAL\ConnectionException $e) { // Handle error try { $result = $db->exec('DROP TABLE ' . $sequenceName); - } catch(Doctrine_Connection_Exception $e) { + } catch(Doctrine\DBAL\ConnectionException $e) { throw \Doctrine\Common\DoctrineException::updateMe('could not drop inconsistent sequence table'); } } @@ -587,5 +587,4 @@ public function getIntegerDeclaration($name, array $field) $name = $this->_conn->quoteIdentifier($name, true); return $name . ' ' . $type . $unsigned . $default . $notnull . $autoinc; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Statement.php b/lib/Doctrine/DBAL/Statement.php index c4541e0cb9d..fb481aa6bdd 100644 --- a/lib/Doctrine/DBAL/Statement.php +++ b/lib/Doctrine/DBAL/Statement.php @@ -125,9 +125,9 @@ public function bindValue($param, $value, $type = null) /** * Binds a PHP variable to a corresponding named or question mark placeholder in the - * SQL statement that was use to prepare the statement. Unlike Doctrine_Adapter_Statement_Interface->bindValue(), + * SQL statement that was use to prepare the statement. Unlike PDOStatement->bindValue(), * the variable is bound as a reference and will only be evaluated at the time - * that Doctrine_Adapter_Statement_Interface->execute() is called. + * that PDOStatement->execute() is called. * * Most parameters are input parameters, that is, parameters that are * used in a read-only fashion to build up the query. Some drivers support the invocation @@ -172,7 +172,7 @@ public function closeCursor() * Returns the number of columns in the result set * * @return integer Returns the number of columns in the result set represented - * by the Doctrine_Adapter_Statement_Interface object. If there is no result set, + * by the PDOStatement object. If there is no result set, * this method should return 0. */ public function columnCount() @@ -250,18 +250,18 @@ public function execute($params = null) * this value determines which row will be returned to the caller. * This value must be one of the Query::HYDRATE_ORI_* constants, defaulting to * Query::HYDRATE_ORI_NEXT. To request a scrollable cursor for your - * Doctrine_Adapter_Statement_Interface object, + * PDOStatement object, * you must set the PDO::ATTR_CURSOR attribute to Doctrine::CURSOR_SCROLL when you * prepare the SQL statement with Doctrine_Adapter_Interface->prepare(). * - * @param integer $cursorOffset For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for which the + * @param integer $cursorOffset For a PDOStatement object representing a scrollable cursor for which the * $cursorOrientation parameter is set to Query::HYDRATE_ORI_ABS, this value specifies * the absolute number of the row in the result set that shall be fetched. * - * For a Doctrine_Adapter_Statement_Interface object representing a scrollable cursor for + * For a PDOStatement object representing a scrollable cursor for * which the $cursorOrientation parameter is set to Query::HYDRATE_ORI_REL, this value * specifies the row to fetch relative to the cursor position before - * Doctrine_Adapter_Statement_Interface->fetch() was called. + * PDOStatement->fetch() was called. * * @return mixed */ @@ -323,7 +323,7 @@ public function fetchAll($fetchMode = Query::HYDRATE_BOTH, $columnIndex = null) * result set or FALSE if there are no more rows. * * @param integer $columnIndex 0-indexed number of the column you wish to retrieve from the row. If no - * value is supplied, Doctrine_Adapter_Statement_Interface->fetchColumn() + * value is supplied, PDOStatement->fetchColumn() * fetches the first column. * * @return string returns a single column in the next row of a result set. @@ -337,7 +337,7 @@ public function fetchColumn($columnIndex = 0) * Fetches the next row and returns it as an object. * * Fetches the next row and returns it as an object. This function is an alternative to - * Doctrine_Adapter_Statement_Interface->fetch() with Query::HYDRATE_CLASS or Query::HYDRATE_OBJ style. + * PDOStatement->fetch() with Query::HYDRATE_CLASS or Query::HYDRATE_OBJ style. * * @param string $className Name of the created class, defaults to stdClass. * @param array $args Elements of this array are passed to the constructor. @@ -435,4 +435,4 @@ public function setFetchMode($mode, $arg1 = null, $arg2 = null) { return $this->_stmt->setFetchMode($mode, $arg1, $arg2); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/ArrayType.php b/lib/Doctrine/DBAL/Types/ArrayType.php index 44c95b023de..55e071651ef 100644 --- a/lib/Doctrine/DBAL/Types/ArrayType.php +++ b/lib/Doctrine/DBAL/Types/ArrayType.php @@ -9,11 +9,8 @@ */ class ArrayType extends Type { - - public function getName() { return 'Array'; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/BigIntType.php b/lib/Doctrine/DBAL/Types/BigIntType.php index 92a96e45299..8b645566886 100644 --- a/lib/Doctrine/DBAL/Types/BigIntType.php +++ b/lib/Doctrine/DBAL/Types/BigIntType.php @@ -10,5 +10,4 @@ class BigIntType extends Type { //put your code here -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/BooleanType.php b/lib/Doctrine/DBAL/Types/BooleanType.php index 0ad3eabe350..1d2de720d93 100644 --- a/lib/Doctrine/DBAL/Types/BooleanType.php +++ b/lib/Doctrine/DBAL/Types/BooleanType.php @@ -30,5 +30,4 @@ public function convertToObjectValue($value) { return (bool)$value; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/CharType.php b/lib/Doctrine/DBAL/Types/CharType.php index d7feb25b814..133e10116c7 100644 --- a/lib/Doctrine/DBAL/Types/CharType.php +++ b/lib/Doctrine/DBAL/Types/CharType.php @@ -10,5 +10,4 @@ class CharType { //put your code here -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/DateTimeType.php b/lib/Doctrine/DBAL/Types/DateTimeType.php index 8f816aa288b..26993848924 100644 --- a/lib/Doctrine/DBAL/Types/DateTimeType.php +++ b/lib/Doctrine/DBAL/Types/DateTimeType.php @@ -32,6 +32,4 @@ public function convertToObjectValue($value) { return new DateTime($value); } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/DecimalType.php b/lib/Doctrine/DBAL/Types/DecimalType.php index 11e2112affe..68f4f6ccc81 100644 --- a/lib/Doctrine/DBAL/Types/DecimalType.php +++ b/lib/Doctrine/DBAL/Types/DecimalType.php @@ -9,5 +9,4 @@ class DecimalType extends Type { -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/IntegerType.php b/lib/Doctrine/DBAL/Types/IntegerType.php index 8b9a010617f..608bb31f353 100644 --- a/lib/Doctrine/DBAL/Types/IntegerType.php +++ b/lib/Doctrine/DBAL/Types/IntegerType.php @@ -8,7 +8,6 @@ */ class IntegerType extends Type { - public function getName() { return "Integer"; diff --git a/lib/Doctrine/DBAL/Types/MediumIntType.php b/lib/Doctrine/DBAL/Types/MediumIntType.php index 119d71b4ec1..c57897d47ee 100644 --- a/lib/Doctrine/DBAL/Types/MediumIntType.php +++ b/lib/Doctrine/DBAL/Types/MediumIntType.php @@ -10,5 +10,4 @@ class MediumIntType { //put your code here -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/SmallIntType.php b/lib/Doctrine/DBAL/Types/SmallIntType.php index 3c438d909b1..5ab13408ac5 100644 --- a/lib/Doctrine/DBAL/Types/SmallIntType.php +++ b/lib/Doctrine/DBAL/Types/SmallIntType.php @@ -10,5 +10,4 @@ class SmallIntType { //put your code here -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/TextType.php b/lib/Doctrine/DBAL/Types/TextType.php index c31d0d45ade..c2fc4870fdb 100644 --- a/lib/Doctrine/DBAL/Types/TextType.php +++ b/lib/Doctrine/DBAL/Types/TextType.php @@ -14,6 +14,4 @@ public function getSqlDeclaration(array $fieldDeclaration, Doctrine_DatabasePlat { return $platform->getClobDeclarationSql($fieldDeclaration); } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/TinyIntType.php b/lib/Doctrine/DBAL/Types/TinyIntType.php index cc50e559536..37f373fdf99 100644 --- a/lib/Doctrine/DBAL/Types/TinyIntType.php +++ b/lib/Doctrine/DBAL/Types/TinyIntType.php @@ -10,5 +10,4 @@ class TinyIntType { //put your code here -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/Type.php b/lib/Doctrine/DBAL/Types/Type.php index b007d45fe3f..d97df5ca8fc 100644 --- a/lib/Doctrine/DBAL/Types/Type.php +++ b/lib/Doctrine/DBAL/Types/Type.php @@ -2,7 +2,7 @@ namespace Doctrine\DBAL\Types; -#use Doctrine\DBAL\Platforms\AbstractDatabasePlatform; +use Doctrine\DBAL\Platforms\AbstractPlatform; abstract class Type { @@ -90,5 +90,4 @@ public static function overrideType($name, $className) } self::$_typesMap[$name] = $className; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/DBAL/Types/VarcharType.php b/lib/Doctrine/DBAL/Types/VarcharType.php index 2af868c670c..0e4c11b24d0 100644 --- a/lib/Doctrine/DBAL/Types/VarcharType.php +++ b/lib/Doctrine/DBAL/Types/VarcharType.php @@ -22,6 +22,8 @@ public function getDefaultLength(\Doctrine\DBAL\Platforms\AbstractPlatform $plat } /** @override */ - public function getName() { return 'Varchar'; } -} - + public function getName() + { + return 'Varchar'; + } +} \ No newline at end of file diff --git a/lib/Doctrine/Exception.php b/lib/Doctrine/Exception.php deleted file mode 100644 index a5b35658615..00000000000 --- a/lib/Doctrine/Exception.php +++ /dev/null @@ -1,57 +0,0 @@ -. - */ - -#namespace Doctrine::ORM::Exceptions; - -/** - * Doctrine_Exception - * - * @package Doctrine - * @subpackage Exception - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.org - * @since 1.0 - * @version $Revision$ - * @author Konsta Vesterinen - * @author Roman Borschel - * @todo Rename to DoctrineException - */ -class Doctrine_Exception extends Exception -{ - private $_innerException; - - public function __construct($message = "", Doctrine_Exception $innerException = null) - { - parent::__construct($message); - $this->_innerException = $innerException; - } - - public function getInnerException() - { - return $this->_innerException; - } - - public static function notYetImplemented($method, $class) - { - return new self("The method '$method' is not implemented in the class '$class'."); - } - -} diff --git a/lib/Doctrine/ORM/Cache/ApcCache.php b/lib/Doctrine/ORM/Cache/ApcCache.php index 9104ea4f824..a9c602b8193 100644 --- a/lib/Doctrine/ORM/Cache/ApcCache.php +++ b/lib/Doctrine/ORM/Cache/ApcCache.php @@ -74,4 +74,4 @@ public function delete($id) { return apc_delete($id); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Cache/ArrayCache.php b/lib/Doctrine/ORM/Cache/ArrayCache.php index 54c80ed1414..58b90b9ad77 100644 --- a/lib/Doctrine/ORM/Cache/ArrayCache.php +++ b/lib/Doctrine/ORM/Cache/ArrayCache.php @@ -89,4 +89,4 @@ public function count() { return count($this->data); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Cache/Cache.php b/lib/Doctrine/ORM/Cache/Cache.php index f2356544755..e2176b44c07 100644 --- a/lib/Doctrine/ORM/Cache/Cache.php +++ b/lib/Doctrine/ORM/Cache/Cache.php @@ -68,4 +68,4 @@ public function save($id, $data, $lifeTime = false); * @return boolean true if no problem */ public function delete($id); -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Cache/DbCache.php b/lib/Doctrine/ORM/Cache/DbCache.php index 1270fbbfb8e..7ca7eda098c 100644 --- a/lib/Doctrine/ORM/Cache/DbCache.php +++ b/lib/Doctrine/ORM/Cache/DbCache.php @@ -178,4 +178,4 @@ public function createTable() $this->getConnection()->export->createTable($name, $fields, $options); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Cache/MemcacheCache.php b/lib/Doctrine/ORM/Cache/MemcacheCache.php index 9857de7102e..f112074795b 100644 --- a/lib/Doctrine/ORM/Cache/MemcacheCache.php +++ b/lib/Doctrine/ORM/Cache/MemcacheCache.php @@ -98,4 +98,4 @@ public function delete($id) { return $this->_memcache->delete($id); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Events.php b/lib/Doctrine/ORM/Events.php index 4b21c188b81..e424a45836c 100644 --- a/lib/Doctrine/ORM/Events.php +++ b/lib/Doctrine/ORM/Events.php @@ -37,6 +37,4 @@ private function __construct() {} const postDelete = 'postDelete'; const preSave = 'preSave'; const postSave = 'postSave'; - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Id/AbstractIdGenerator.php b/lib/Doctrine/ORM/Id/AbstractIdGenerator.php index 4bbaa7c908e..3541ae6893b 100644 --- a/lib/Doctrine/ORM/Id/AbstractIdGenerator.php +++ b/lib/Doctrine/ORM/Id/AbstractIdGenerator.php @@ -31,8 +31,8 @@ abstract public function generate($entity); * * @return boolean */ - public function isPostInsertGenerator() { + public function isPostInsertGenerator() + { return false; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Id/Assigned.php b/lib/Doctrine/ORM/Id/Assigned.php index d8b0c3d5498..ca2c495680a 100644 --- a/lib/Doctrine/ORM/Id/Assigned.php +++ b/lib/Doctrine/ORM/Id/Assigned.php @@ -66,5 +66,4 @@ public function generate($entity) return $identifier; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Id/IdentityGenerator.php b/lib/Doctrine/ORM/Id/IdentityGenerator.php index f3c9558ad63..f6913343f4f 100644 --- a/lib/Doctrine/ORM/Id/IdentityGenerator.php +++ b/lib/Doctrine/ORM/Id/IdentityGenerator.php @@ -20,8 +20,8 @@ public function generate($entity) * @return boolean * @override */ - public function isPostInsertGenerator() { + public function isPostInsertGenerator() + { return true; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Id/SequenceGenerator.php b/lib/Doctrine/ORM/Id/SequenceGenerator.php index 381648fb15e..b600d8aae99 100644 --- a/lib/Doctrine/ORM/Id/SequenceGenerator.php +++ b/lib/Doctrine/ORM/Id/SequenceGenerator.php @@ -23,5 +23,4 @@ public function generate($entity) $sql = $conn->getDatabasePlatform()->getSequenceNextValSql($this->_sequenceName); return $conn->fetchOne($sql); } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Id/SequenceIdentityGenerator.php b/lib/Doctrine/ORM/Id/SequenceIdentityGenerator.php index 22e20594ef6..b3c187e4c53 100644 --- a/lib/Doctrine/ORM/Id/SequenceIdentityGenerator.php +++ b/lib/Doctrine/ORM/Id/SequenceIdentityGenerator.php @@ -21,6 +21,4 @@ public function getPostInsertId() { return $this->_em->getConnection()->lastInsertId($this->_sequenceName); } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Id/TableGenerator.php b/lib/Doctrine/ORM/Id/TableGenerator.php index 6b98b63a3e0..9221eb75bd4 100644 --- a/lib/Doctrine/ORM/Id/TableGenerator.php +++ b/lib/Doctrine/ORM/Id/TableGenerator.php @@ -9,11 +9,8 @@ */ class TableGenerator extends AbstractIdGenerator { - public function generate($entity) { throw \Doctrine\Common\DoctrineException::updateMe("Not implemented"); } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Import/Exception.php b/lib/Doctrine/ORM/Import/Exception.php deleted file mode 100644 index 0800208e36c..00000000000 --- a/lib/Doctrine/ORM/Import/Exception.php +++ /dev/null @@ -1,34 +0,0 @@ -. - */ - -/** - * class Doctrine_Import_Exception - * - * @package Doctrine - * @subpackage Import - * @link www.phpdoctrine.org - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @since 1.0 - * @version $Revision: 3882 $ - * @author Konsta Vesterinen - */ -class Doctrine_Import_Exception extends Doctrine_Exception -{ } \ No newline at end of file diff --git a/lib/Doctrine/ORM/Import/Reader.php b/lib/Doctrine/ORM/Import/Reader/AbstractReader.php similarity index 82% rename from lib/Doctrine/ORM/Import/Reader.php rename to lib/Doctrine/ORM/Import/Reader/AbstractReader.php index cb0b602b4cc..6e1483d518b 100644 --- a/lib/Doctrine/ORM/Import/Reader.php +++ b/lib/Doctrine/ORM/Import/Reader/AbstractReader.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Import\Reader; + /** * class Doctrine_Import_Reader * Is responsible of reading a database definitions from a source and costructing a @@ -32,21 +34,7 @@ * @version $Revision: 3882 $ * @author Konsta Vesterinen */ -abstract class Doctrine_Import_Reader +abstract class AbstractRader { - - /** Aggregations: */ - - /** Compositions: */ - - /*** Attributes: ***/ - - /** - * - * @return Doctrine_Schema - * @abstract - * @access public - */ - abstract public function read( ); - + abstract public function read(); } \ No newline at end of file diff --git a/lib/Doctrine/ORM/Import/Reader/Db.php b/lib/Doctrine/ORM/Import/Reader/Db.php index 7286661fb96..3936e12fb11 100644 --- a/lib/Doctrine/ORM/Import/Reader/Db.php +++ b/lib/Doctrine/ORM/Import/Reader/Db.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Import\Reader; + /** * class Doctrine_Import_Reader_Db * Reads a database using the given PDO connection and constructs a database @@ -32,14 +34,8 @@ * @version $Revision: 3882 $ * @author Konsta Vesterinen */ -class Doctrine_Import_Reader_Db extends Doctrine_Import_Reader +class Db extends AbstractReader { - /** Aggregations: */ - - /** Compositions: */ - - /*** Attributes: ***/ - /** * @access private */ diff --git a/lib/Doctrine/ORM/Import/Reader/Exception.php b/lib/Doctrine/ORM/Import/Reader/Exception.php deleted file mode 100644 index 1a41f6f6123..00000000000 --- a/lib/Doctrine/ORM/Import/Reader/Exception.php +++ /dev/null @@ -1,42 +0,0 @@ -. - */ - -/** - * class Doctrine_Import_Reader_Exception - * - * @package Doctrine - * @subpackage Import - * @link www.phpdoctrine.org - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @since 1.0 - * @version $Revision: 3882 $ - * @author Konsta Vesterinen - */ -class Doctrine_Import_Reader_Exception -{ - - /** Aggregations: */ - - /** Compositions: */ - - /*** Attributes: ***/ - -} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Import/Reader/Propel.php b/lib/Doctrine/ORM/Import/Reader/Propel.php index 055ff379ff7..9ec8fd9223d 100644 --- a/lib/Doctrine/ORM/Import/Reader/Propel.php +++ b/lib/Doctrine/ORM/Import/Reader/Propel.php @@ -18,7 +18,9 @@ * and is licensed under the LGPL. For more information, see * . */ -Doctrine::autoload('Doctrine_Import_Reader'); + +namespace Doctrine\ORM\Import\Reader; + /** * class Doctrine_Import_Reader_Xml_Propel * @@ -30,15 +32,8 @@ * @version $Revision: 3882 $ * @author Konsta Vesterinen */ -class Doctrine_Import_Reader_Xml_Propel extends Doctrine_Import_Reader +class Propel extends AbstractReader { - - /** Aggregations: */ - - /** Compositions: */ - - /*** Attributes: ***/ - /** * @access private */ diff --git a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php index 5be57fe8e6b..e173f0394d1 100644 --- a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php +++ b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php @@ -145,6 +145,4 @@ public function prependNode($node) { array_unshift($this->_sorted, $node->getClass()); } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Internal/CommitOrderNode.php b/lib/Doctrine/ORM/Internal/CommitOrderNode.php index a658dae4b4d..d3dd048f333 100644 --- a/lib/Doctrine/ORM/Internal/CommitOrderNode.php +++ b/lib/Doctrine/ORM/Internal/CommitOrderNode.php @@ -161,5 +161,4 @@ public function before(CommitOrderNode $node) { $this->_relatedNodes[] = $node; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php index b76d7485db8..7486395500a 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php @@ -362,4 +362,4 @@ public function setResultMixed($bool) { $this->_isResultMixed = $bool; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php index 8635c1be924..fe8300ba61d 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php @@ -208,5 +208,4 @@ protected function _getRowContainer() { return array(); } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Internal/Hydration/Exception.php b/lib/Doctrine/ORM/Internal/Hydration/Exception.php deleted file mode 100644 index 63ed67380b7..00000000000 --- a/lib/Doctrine/ORM/Internal/Hydration/Exception.php +++ /dev/null @@ -1,49 +0,0 @@ -. - */ - -/** - * Doctrine_Hydrator_Exception - * - * @package Doctrine - * @subpackage Hydrate - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.org - * @since 1.0 - * @version $Revision: 1080 $ - * @author Konsta Vesterinen - */ -class Doctrine_Hydrator_Exception extends Doctrine_Exception -{ - public static function nonUniqueKeyMapping() - { - return new self("Hydration failed. Found non-unique key mapping."); - } - - public static function nonExistantFieldUsedAsIndex($field) - { - return new self("Hydration failed. Found a non-existent field '$field'."); - } - - public static function nonUniqueResult() - { - return new self("Hydration failed. Non-unique result returned."); - } -} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php b/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php index 19c6c2e07da..6c4060a0d61 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php +++ b/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php @@ -4,11 +4,8 @@ class HydrationException extends \Doctrine\Common\DoctrineException { - public static function nonUniqueResult() { return new self("The result returned by the query was not unique."); } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php b/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php index d0476d265a3..e3494a50aa1 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php +++ b/lib/Doctrine/ORM/Internal/Hydration/IterableResult.php @@ -46,5 +46,4 @@ public function next() { return $this->_hydrator->hydrateRow(); } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php index 56e7f387e96..6b12add6fc6 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php @@ -395,5 +395,4 @@ protected function _getRowContainer() { return new \Doctrine\Common\Collections\Collection; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php index 9b8984c9d84..a8a2714926d 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php @@ -36,5 +36,4 @@ protected function _getRowContainer() { return array(); } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php index f968f1db99c..586e00b70aa 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/SingleScalarHydrator.php @@ -33,5 +33,4 @@ protected function _getRowContainer() { return array(); } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Mapping/AssociationMapping.php b/lib/Doctrine/ORM/Mapping/AssociationMapping.php index 88c59191793..7dedd282fcf 100644 --- a/lib/Doctrine/ORM/Mapping/AssociationMapping.php +++ b/lib/Doctrine/ORM/Mapping/AssociationMapping.php @@ -339,5 +339,4 @@ public function usesJoinTable() } abstract public function lazyLoadFor($entity, $entityManager); -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadata.php b/lib/Doctrine/ORM/Mapping/ClassMetadata.php index 18865042f0b..6ac0f71ea65 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadata.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadata.php @@ -1476,5 +1476,4 @@ public function __toString() { return __CLASS__ . '@' . spl_object_hash($this); } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index eb8bca9fc5b..a3b2a3b91ee 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -205,7 +205,4 @@ private function _completeIdGeneratorMapping(ClassMetadata $class) } } } -} - - - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index dcbdd1f9155..2c5640eec44 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -173,4 +173,4 @@ public function isTransient($className) return strpos($docComment, '@DoctrineEntity') === false && strpos($docComment, '@DoctrineMappedSuperclass') === false; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php b/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php index 6f48c4ae128..6e1e8856c60 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php @@ -83,4 +83,4 @@ final class DoctrineJoinTable extends \Addendum\Annotation { public $schema; public $joinColumns; public $inverseJoinColumns; -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Mapping/ManyToManyMapping.php b/lib/Doctrine/ORM/Mapping/ManyToManyMapping.php index 521d5480100..89838c54368 100644 --- a/lib/Doctrine/ORM/Mapping/ManyToManyMapping.php +++ b/lib/Doctrine/ORM/Mapping/ManyToManyMapping.php @@ -141,5 +141,4 @@ public function isManyToMany() { return true; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Mapping/MappingException.php b/lib/Doctrine/ORM/Mapping/MappingException.php index a581f76ed51..2c76ba761b9 100644 --- a/lib/Doctrine/ORM/Mapping/MappingException.php +++ b/lib/Doctrine/ORM/Mapping/MappingException.php @@ -83,6 +83,4 @@ public static function invalidMapping($fieldName) { return new self("The mapping of field '$fieldName' is invalid."); } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Mapping/OneToManyMapping.php b/lib/Doctrine/ORM/Mapping/OneToManyMapping.php index 01bad07342e..6d8c30a0c1c 100644 --- a/lib/Doctrine/ORM/Mapping/OneToManyMapping.php +++ b/lib/Doctrine/ORM/Mapping/OneToManyMapping.php @@ -112,6 +112,4 @@ public function lazyLoadFor($entity, $entityManager) { } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Mapping/OneToOneMapping.php b/lib/Doctrine/ORM/Mapping/OneToOneMapping.php index eb9f20eb564..8fd51c925a7 100644 --- a/lib/Doctrine/ORM/Mapping/OneToOneMapping.php +++ b/lib/Doctrine/ORM/Mapping/OneToOneMapping.php @@ -163,6 +163,4 @@ public function lazyLoadFor($entity, $entityManager) } $sourceClass->getReflectionProperty($this->_sourceFieldName)->setValue($entity, $otherEntity); } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 88dd0fa7511..8406e10e227 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -395,4 +395,4 @@ public function setDirty($dirty) { $this->_isDirty = $dirty; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php b/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php index 60703727e5e..8b81c66d10b 100644 --- a/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php +++ b/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php @@ -160,5 +160,4 @@ abstract protected function _getInsertRowSql(PersistentCollection $coll); * @param mixed $element */ abstract protected function _getInsertRowSqlParameters(PersistentCollection $coll, $element); -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Persisters/AbstractEntityPersister.php b/lib/Doctrine/ORM/Persisters/AbstractEntityPersister.php index bba16614d4d..548541081b0 100644 --- a/lib/Doctrine/ORM/Persisters/AbstractEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/AbstractEntityPersister.php @@ -237,4 +237,4 @@ protected function _prepareData($entity, array &$result, $isInsert = false) $result[$discColumn['name']] = array_search($this->_entityName, $discMap); } } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php b/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php index 947f51ef67e..ed802ac5eaa 100644 --- a/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php +++ b/lib/Doctrine/ORM/Persisters/ElementCollectionPersister.php @@ -29,5 +29,4 @@ class ElementCollectionPersister extends AbstractCollectionPersister { //put your code here -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Persisters/Exception.php b/lib/Doctrine/ORM/Persisters/Exception.php deleted file mode 100644 index 36965d7bc83..00000000000 --- a/lib/Doctrine/ORM/Persisters/Exception.php +++ /dev/null @@ -1,38 +0,0 @@ -. - */ - -#namespace Doctrine::ORM; - -/** - * Doctrine_EntityPersister_Exception - * - * @package Doctrine - * @subpackage Entity - * @author Konsta Vesterinen - * @author Roman Borschel - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.org - * @since 2.0 - * @version $Revision$ - */ -class Doctrine_EntityPersister_Exception extends Doctrine_Exception -{ -} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php index 9bea3c0e41c..b3d9345fc96 100644 --- a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php +++ b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php @@ -277,5 +277,4 @@ protected function _groupFieldsByDefiningClass(Doctrine_ClassMetadata $class, ar return $dataSet; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php index 9f69c098de1..7967299c4a9 100644 --- a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php @@ -126,5 +126,4 @@ protected function _getDeleteSqlParameters(PersistentCollection $coll) // rely on a specific ordering of the columns. return $this->_uow->getEntityIdentifier($coll->getOwner()); } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php b/lib/Doctrine/ORM/Persisters/OneToManyPersister.php index eb89fa53ba2..2ab99e9fb11 100644 --- a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/OneToManyPersister.php @@ -73,6 +73,4 @@ protected function _getUpdateRowSql() { return; } - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php index 15c5adc7fae..9da60824365 100644 --- a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php +++ b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php @@ -1,3 +1,8 @@ \ No newline at end of file +namespace Doctrine\ORM\Persisters; + +class SingleTablePersister extends AbstractEntityPersister +{ + +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php b/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php index 15c5adc7fae..05ee49b7edf 100644 --- a/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php +++ b/lib/Doctrine/ORM/Persisters/UnionSubclassPersister.php @@ -1,3 +1,8 @@ \ No newline at end of file +namespace Doctrine\ORM\Persisters; + +class UnionSubclassPersister extends AbstractEntityPersister +{ + +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index e290b6ca6f8..1f559e6fb36 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -587,4 +587,4 @@ public function iterate(array $params = array(), $hydrationMode = self::HYDRATE_ $this->_execute($params, $hydrationMode), $this->_parserResult ); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/AggregateExpression.php b/lib/Doctrine/ORM/Query/AST/AggregateExpression.php index 8e799cc369e..4a355d5bf55 100644 --- a/lib/Doctrine/ORM/Query/AST/AggregateExpression.php +++ b/lib/Doctrine/ORM/Query/AST/AggregateExpression.php @@ -38,5 +38,4 @@ public function getFunctionName() { return $this->_functionName; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php b/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php index 6e008a61ba6..f49ec93cc46 100644 --- a/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php +++ b/lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php @@ -18,13 +18,17 @@ class ArithmeticExpression extends Node public function setSimpleArithmeticExpression($simpleArithmeticExpr) { - if ($this->_subselect) throw \Doctrine\Common\DoctrineException::updateMe(); + if ($this->_subselect) { + throw \Doctrine\Common\DoctrineException::updateMe(); + } $this->_simpleArithmeticExpression = $simpleArithmeticExpr; } public function setSubselect($subselect) { - if ($this->_simpleArithmeticExpression) throw \Doctrine\Common\DoctrineException::updateMe(); + if ($this->_simpleArithmeticExpression){ + throw \Doctrine\Common\DoctrineException::updateMe(); + } $this->_subselect = $subselect; } @@ -40,12 +44,11 @@ public function getSubselect() public function isSimpleArithmeticExpression() { - return (bool)$this->_simpleArithmeticExpression; + return (bool) $this->_simpleArithmeticExpression; } public function isSubselect() { - return (bool)$this->_subselect; + return (bool) $this->_subselect; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php b/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php index f93c8c95db8..c2c9c94a1b7 100644 --- a/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php +++ b/lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php @@ -38,5 +38,4 @@ public function isNegativeSigned() { return $this->_nSigned; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php b/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php index 057fd44403e..1ce611b1953 100644 --- a/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php +++ b/lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php @@ -24,5 +24,4 @@ public function getArithmeticFactors() { return $this->_factors; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php b/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php index fbbd20a4c0b..f2cf87ad79b 100644 --- a/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php +++ b/lib/Doctrine/ORM/Query/AST/ComparisonExpression.php @@ -43,5 +43,4 @@ public function getOperator() { return $this->_operator; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/ComparisonOperator.php b/lib/Doctrine/ORM/Query/AST/ComparisonOperator.php index 0db7c769fd1..662da36c5f4 100644 --- a/lib/Doctrine/ORM/Query/AST/ComparisonOperator.php +++ b/lib/Doctrine/ORM/Query/AST/ComparisonOperator.php @@ -35,5 +35,4 @@ */ class ComparisonOperator extends Node { - -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php b/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php index 0479dddd29c..1d019b53111 100644 --- a/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php +++ b/lib/Doctrine/ORM/Query/AST/ConditionalExpression.php @@ -24,5 +24,4 @@ public function getConditionalTerms() { return $this->_conditionalTerms; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php b/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php index bf69abe1c1c..e7f460980b7 100644 --- a/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php +++ b/lib/Doctrine/ORM/Query/AST/ConditionalFactor.php @@ -31,5 +31,4 @@ public function getConditionalPrimary() { return $this->_conditionalPrimary; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php b/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php index b776076ae7a..15f62d2f233 100644 --- a/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php +++ b/lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php @@ -38,12 +38,11 @@ public function getConditionalExpression() public function isSimpleConditionalExpression() { - return (bool)$this->_simpleConditionalExpression; + return (bool) $this->_simpleConditionalExpression; } public function isConditionalExpression() { - return (bool)$this->_conditionalExpression; + return (bool) $this->_conditionalExpression; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php b/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php index 41956f8a158..b665f81bdf4 100644 --- a/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php +++ b/lib/Doctrine/ORM/Query/AST/ConditionalTerm.php @@ -24,5 +24,4 @@ public function getConditionalFactors() { return $this->_conditionalFactors; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/DeleteStatement.php b/lib/Doctrine/ORM/Query/AST/DeleteStatement.php index ad859aafe38..04f8e947780 100644 --- a/lib/Doctrine/ORM/Query/AST/DeleteStatement.php +++ b/lib/Doctrine/ORM/Query/AST/DeleteStatement.php @@ -33,36 +33,30 @@ class DeleteStatement extends Node { protected $_deleteClause; - protected $_whereClause; - /* Setters */ public function setDeleteClause($deleteClause) { $this->_deleteClause = $deleteClause; } - public function setWhereClause($whereClause) { $this->_whereClause = $whereClause; } - /* Getters */ public function getDeleteClause() { return $this->_deleteClause; } - public function getWhereClause() { return $this->_whereClause; } - /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ public function buildSql() @@ -72,4 +66,4 @@ public function buildSql() return $this->_deleteClause->buildSql() . (($this->_whereClause !== null) ? ' ' . $this->_whereClause->buildSql() : ' WHERE 1 = 1'); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/FromClause.php b/lib/Doctrine/ORM/Query/AST/FromClause.php index 2267e10196e..14bbb8563fd 100644 --- a/lib/Doctrine/ORM/Query/AST/FromClause.php +++ b/lib/Doctrine/ORM/Query/AST/FromClause.php @@ -45,9 +45,7 @@ public function getIdentificationVariableDeclarations() return $this->_identificationVariableDeclarations; } - /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ - public function buildSql() { //echo "FromClause:\n"; @@ -60,7 +58,6 @@ public function buildSql() return 'FROM ' . implode(', ', $this->_mapIdentificationVariableDeclarations()); } - protected function _mapIdentificationVariableDeclarations() { return array_map( @@ -68,9 +65,8 @@ protected function _mapIdentificationVariableDeclarations() ); } - protected function _mapIdentificationVariableDeclaration($value) { return $value->buildSql(); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/Function.php b/lib/Doctrine/ORM/Query/AST/Function.php index 7fa7adcbb2d..98b5451e8f5 100644 --- a/lib/Doctrine/ORM/Query/AST/Function.php +++ b/lib/Doctrine/ORM/Query/AST/Function.php @@ -14,7 +14,4 @@ class FunctionNode extends Node { private $_name; - - -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/GroupByClause.php b/lib/Doctrine/ORM/Query/AST/GroupByClause.php index c70db146e2d..1715991dbd7 100644 --- a/lib/Doctrine/ORM/Query/AST/GroupByClause.php +++ b/lib/Doctrine/ORM/Query/AST/GroupByClause.php @@ -24,5 +24,4 @@ public function getGroupByItems() { return $this->_groupByItems; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php b/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php index 45c4360444e..2f13ffacd1e 100644 --- a/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php +++ b/lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php @@ -63,7 +63,6 @@ public function getJoinVariableDeclarations() return $this->_joinVariableDeclarations; } - /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ public function buildSql() diff --git a/lib/Doctrine/ORM/Query/AST/InputParameter.php b/lib/Doctrine/ORM/Query/AST/InputParameter.php index 66a3335a1f8..36e110c4ac5 100644 --- a/lib/Doctrine/ORM/Query/AST/InputParameter.php +++ b/lib/Doctrine/ORM/Query/AST/InputParameter.php @@ -47,5 +47,4 @@ public function getPosition() { return $this->_position; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/Join.php b/lib/Doctrine/ORM/Query/AST/Join.php index 96c1b0b4106..c0f42c3eb47 100644 --- a/lib/Doctrine/ORM/Query/AST/Join.php +++ b/lib/Doctrine/ORM/Query/AST/Join.php @@ -34,25 +34,15 @@ class Join extends Node { const JOIN_TYPE_LEFT = 1; - const JOIN_TYPE_LEFTOUTER = 2; - const JOIN_TYPE_INNER = 3; - - const JOIN_WHERE_ON = 1; - const JOIN_WHERE_WITH = 2; - - protected $_joinType = self::JOIN_TYPE_INNER; - + protected $_joinType = self::JOIN_TYPE_INNER; protected $_joinAssociationPathExpression = null; - protected $_aliasIdentificationVariable = null; - protected $_whereType = self::JOIN_WHERE_WITH; - protected $_conditionalExpression = null; public function __construct($joinType, $joinAssocPathExpr, $aliasIdentVar) @@ -74,7 +64,6 @@ public function setConditionalExpression($conditionalExpression) $this->_conditionalExpression = $conditionalExpression; } - /* Getters */ public function getJoinType() { @@ -101,7 +90,6 @@ public function getConditionalExpression() return $this->_conditionalExpression; } - /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ public function buildSql() diff --git a/lib/Doctrine/ORM/Query/AST/JoinPathExpression.php b/lib/Doctrine/ORM/Query/AST/JoinPathExpression.php index 2d1b868e33f..d55bb821d10 100644 --- a/lib/Doctrine/ORM/Query/AST/JoinPathExpression.php +++ b/lib/Doctrine/ORM/Query/AST/JoinPathExpression.php @@ -31,5 +31,4 @@ public function getAssociationField() { return $this->_assocField; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php b/lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php index 8db47445ef4..cfb4bff46f8 100644 --- a/lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php +++ b/lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php @@ -33,7 +33,6 @@ class JoinVariableDeclaration extends Node { protected $_join = null; - protected $_indexBy = null; public function __construct($join, $indexBy) @@ -48,15 +47,12 @@ public function getJoin() return $this->_join; } - public function getIndexBy() { return $this->_indexBy; } - /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ - public function buildSql() { return $this->_join->buildSql() . (isset($this->_indexby) ? $this->_indexby->buildSql() . ' ' : ''); diff --git a/lib/Doctrine/ORM/Query/AST/LikeExpression.php b/lib/Doctrine/ORM/Query/AST/LikeExpression.php index c89e5e889ba..7959fbf1b85 100644 --- a/lib/Doctrine/ORM/Query/AST/LikeExpression.php +++ b/lib/Doctrine/ORM/Query/AST/LikeExpression.php @@ -45,5 +45,4 @@ public function getEscapeChar() { return $this->_escapeChar; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/PathExpression.php b/lib/Doctrine/ORM/Query/AST/PathExpression.php index 47ec7898392..50f13fa38e5 100644 --- a/lib/Doctrine/ORM/Query/AST/PathExpression.php +++ b/lib/Doctrine/ORM/Query/AST/PathExpression.php @@ -95,5 +95,4 @@ public function setIsCollectionValuedAssociationPart($part) { $this->_collectionValuedAssociationFields[$part] = true; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php b/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php index f267857f78b..07f68969526 100644 --- a/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php +++ b/lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php @@ -59,9 +59,7 @@ public function getClassMetadata() return $this->_classMetadata; } - /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ - public function buildSql() { // Retrieving connection diff --git a/lib/Doctrine/ORM/Query/AST/SelectClause.php b/lib/Doctrine/ORM/Query/AST/SelectClause.php index 6bdb5ded012..a129bcfb3e4 100644 --- a/lib/Doctrine/ORM/Query/AST/SelectClause.php +++ b/lib/Doctrine/ORM/Query/AST/SelectClause.php @@ -48,30 +48,25 @@ public function isDistinct() return $this->_isDistinct; } - public function getSelectExpressions() { return $this->_selectExpressions; } - /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ - public function buildSql() { return 'SELECT ' . (($this->_isDistinct) ? 'DISTINCT ' : '') . implode(', ', $this->_mapSelectExpressions()); } - protected function _mapSelectExpressions() { return array_map(array(&$this, '_mapSelectExpression'), $this->_selectExpressions); } - protected function _mapSelectExpression($value) { return is_object($value) ? $value->buildSql() : $value; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/SelectExpression.php b/lib/Doctrine/ORM/Query/AST/SelectExpression.php index 7cf2da0b0fc..a107fe248a2 100644 --- a/lib/Doctrine/ORM/Query/AST/SelectExpression.php +++ b/lib/Doctrine/ORM/Query/AST/SelectExpression.php @@ -34,7 +34,6 @@ class SelectExpression extends Node { protected $_expression; - protected $_fieldIdentificationVariable; public function __construct($expression, $fieldIdentificationVariable) diff --git a/lib/Doctrine/ORM/Query/AST/SelectStatement.php b/lib/Doctrine/ORM/Query/AST/SelectStatement.php index 97edc4b2c38..7d7629ff2b8 100644 --- a/lib/Doctrine/ORM/Query/AST/SelectStatement.php +++ b/lib/Doctrine/ORM/Query/AST/SelectStatement.php @@ -55,37 +55,31 @@ public function getSelectClause() return $this->_selectClause; } - public function getFromClause() { return $this->_fromClause; } - public function getWhereClause() { return $this->_whereClause; } - public function getGroupByClause() { return $this->_groupByClause; } - public function getHavingClause() { return $this->_havingClause; } - public function getOrderByClause() { return $this->_orderByClause; } - /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ public function buildSql() diff --git a/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php b/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php index 4e5f07a85fe..6f4b0e8e9f5 100644 --- a/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php +++ b/lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php @@ -24,5 +24,4 @@ public function getArithmeticTerms() { return $this->_terms; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AST/SimpleStateFieldPathExpression.php b/lib/Doctrine/ORM/Query/AST/SimpleStateFieldPathExpression.php index 2ca59a07fec..1ca3b029a5f 100644 --- a/lib/Doctrine/ORM/Query/AST/SimpleStateFieldPathExpression.php +++ b/lib/Doctrine/ORM/Query/AST/SimpleStateFieldPathExpression.php @@ -33,7 +33,6 @@ class SimpleStateFieldPathExpression extends Node { protected $_identificationVariable = null; - protected $_simpleStateField = null; public function __construct($identificationVariable, $simpleStateField) @@ -48,7 +47,6 @@ public function getIdentificationVariable() return $this->_identificationVariable; } - public function getSimpleStateField() { return $this->_simpleStateField; diff --git a/lib/Doctrine/ORM/Query/AST/UpdateStatetement.php b/lib/Doctrine/ORM/Query/AST/UpdateStatetement.php index db1cd1bb05c..c900f730d82 100644 --- a/lib/Doctrine/ORM/Query/AST/UpdateStatetement.php +++ b/lib/Doctrine/ORM/Query/AST/UpdateStatetement.php @@ -33,22 +33,18 @@ class UpdateStatement extends Node { protected $_updateClause; - protected $_whereClause; - /* Setters */ public function setUpdateClause($updateClause) { $this->_updateClause = $updateClause; } - public function setWhereClause($whereClause) { $this->_whereClause = $whereClause; } - /* Getters */ public function getUpdateClause() @@ -56,15 +52,12 @@ public function getUpdateClause() return $this->_updateClause; } - public function getWhereClause() { return $this->_whereClause; } - /* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */ - public function buildSql() { // The 1=1 is needed to workaround the affected_rows in MySQL. diff --git a/lib/Doctrine/ORM/Query/AST/WhereClause.php b/lib/Doctrine/ORM/Query/AST/WhereClause.php index 5585168eceb..5d19dbd05ce 100644 --- a/lib/Doctrine/ORM/Query/AST/WhereClause.php +++ b/lib/Doctrine/ORM/Query/AST/WhereClause.php @@ -24,5 +24,4 @@ public function getConditionalExpression() { return $this->_conditionalExpression; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/AbstractResult.php b/lib/Doctrine/ORM/Query/AbstractResult.php index 73035b824db..89c9a10c3ba 100644 --- a/lib/Doctrine/ORM/Query/AbstractResult.php +++ b/lib/Doctrine/ORM/Query/AbstractResult.php @@ -62,7 +62,6 @@ abstract class AbstractResult */ protected $_enumParams; - /** * Cannot be called directly, factory methods handle this job. * @@ -80,7 +79,6 @@ public function __construct($data = '', $queryComponents = array(), $tableAliasM $this->_enumParams = $enumParams; } - /** * Defines the mapping components. * @@ -91,7 +89,6 @@ public function setQueryComponents(array $queryComponents) $this->_queryComponents = $queryComponents; } - /** * Sets the declaration for given component alias. * @@ -103,7 +100,6 @@ public function setQueryComponent($componentAlias, array $queryComponent) $this->_queryComponents[$componentAlias] = $queryComponent; } - /** * Gets the mapping components. * @@ -114,7 +110,6 @@ public function getQueryComponents() return $this->_queryComponents; } - /** * Get the declaration for given component alias. * @@ -130,7 +125,6 @@ public function getQueryComponent($componentAlias) return $this->_queryComponents[$componentAlias]; } - /** * Get the component alias for a given query component * @@ -142,7 +136,6 @@ public function getComponentAlias($queryComponent) return array_search($queryComponent, $this->_queryComponents);; } - /** * Whether or not this object has a declaration for given component alias. * @@ -154,7 +147,6 @@ public function hasQueryComponent($componentAlias) return isset($this->_queryComponents[$componentAlias]); } - /** * Defines the table aliases. * @@ -165,7 +157,6 @@ public function setTableAliasMap(array $tableAliasMap) $this->_tableAliasMap = $tableAliasMap; } - /** * Adds an SQL table alias and associates it a component alias * @@ -177,7 +168,6 @@ public function setTableAlias($tableAlias, $componentAlias) $this->_tableAliasMap[$tableAlias] = $componentAlias; } - /** * Returns all table aliases. * @@ -188,7 +178,6 @@ public function getTableAliasMap() return $this->_tableAliasMap; } - /** * Get DQL alias associated with given SQL table alias. * @@ -204,7 +193,6 @@ public function getTableAlias($tableAlias) return $this->_tableAliasMap[$tableAlias]; } - /** * Get table alias associated with given component alias. * @@ -216,7 +204,6 @@ public function getTableAliasFromComponentAlias($componentAlias) return array_search($componentAlias, $this->_tableAliasMap); } - /** * Whether or not this object has given tableAlias. * @@ -228,7 +215,6 @@ public function hasTableAlias($tableAlias) return (isset($this->_tableAliasMap[$tableAlias])); } - /** * Returns the enum parameters. * @@ -239,7 +225,6 @@ public function getEnumParams() return $this->_enumParams; } - /** * Sets input parameter as an enumerated parameter * @@ -259,7 +244,6 @@ public function addEnumParam($key, $table = null, $column = null) return $this; } - /** * Returns this object in serialized format, revertable using fromCached*. * diff --git a/lib/Doctrine/ORM/Query/CacheHandler.php b/lib/Doctrine/ORM/Query/CacheHandler.php index d271f99ef8a..3385e06abe5 100644 --- a/lib/Doctrine/ORM/Query/CacheHandler.php +++ b/lib/Doctrine/ORM/Query/CacheHandler.php @@ -19,10 +19,10 @@ * . */ -#namespace Doctrine\ORM\Query; +namespace Doctrine\ORM\Query; /** - * Doctrine_ORM_Query_CacheHandler + * Doctrine\ORM\Query\CacheHandler * * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.com @@ -33,7 +33,7 @@ * * @todo Re-document this class */ -abstract class Doctrine_ORM_Query_CacheHandler +abstract class CacheHandler { /** * Static factory method. Receives a Doctrine_ORM_Query object and generates @@ -64,7 +64,7 @@ public static function fromResultSet($result, $parserResult) } } - return new Doctrine_ORM_Query_QueryResult( + return new QueryResult( $result, $queryComponents, $parserResult->getTableAliasMap(), @@ -72,8 +72,6 @@ public static function fromResultSet($result, $parserResult) ); } - - /** * Static factory method. Receives a Doctrine_ORM_Query object and a cached data. * It handles the cache and generates the object after processing queryComponents. @@ -86,7 +84,7 @@ public static function fromCachedResult($query, $cached = false) { $cached = unserialize($cached); - return new Doctrine_ORM_Query_QueryResult( + return new QueryResult( $cached[0], self::_getQueryComponents($cached[1]), $cached[2], @@ -94,7 +92,6 @@ public static function fromCachedResult($query, $cached = false) ); } - /** * Static factory method. Receives a Doctrine_ORM_Query object and a cached data. * It handles the cache and generates the object after processing queryComponents. @@ -107,7 +104,7 @@ public static function fromCachedQuery($query, $cached = false) { $cached = unserialize($cached); - return new Doctrine_ORM_Query_ParserResult( + return new ParserResult( $cached[0], self::_getQueryComponents($cached[1]), $cached[2], @@ -115,7 +112,6 @@ public static function fromCachedQuery($query, $cached = false) ); } - /** * @nodoc */ @@ -147,5 +143,4 @@ protected static function _getQueryComponents($query, $cachedQueryComponents) return $queryComponents; } - } \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Exception.php b/lib/Doctrine/ORM/Query/Exception.php deleted file mode 100644 index 7937f168c4e..00000000000 --- a/lib/Doctrine/ORM/Query/Exception.php +++ /dev/null @@ -1,37 +0,0 @@ -. - */ - -/** - * Doctrine_ORM_Query_Exception - * - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link www.phpdoctrine.org - * @since 1.0 - * @version $Revision: 4628 $ - * @author Konsta Vesterinen - */ -class Doctrine_ORM_Query_Exception extends Doctrine_Exception -{ - public static function nonUniqueResult() - { - return new self("The query contains more than one result."); - } -} diff --git a/lib/Doctrine/ORM/Query/Exec/AbstractExecutor.php b/lib/Doctrine/ORM/Query/Exec/AbstractExecutor.php index 62bdbf843a7..5e2e2191449 100644 --- a/lib/Doctrine/ORM/Query/Exec/AbstractExecutor.php +++ b/lib/Doctrine/ORM/Query/Exec/AbstractExecutor.php @@ -85,7 +85,6 @@ public static function create(\Doctrine\ORM\Query\AST\Node $AST, $sqlWalker) } } - /** * Serializes the sql statements of the executor. * @@ -96,7 +95,6 @@ public function serialize() return serialize($this->_sqlStatements); } - /** * Reconstructs the executor with it's sql statements. */ diff --git a/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php b/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php index c7d57f4d0bb..d0d10c9f780 100644 --- a/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php +++ b/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Exec; + /** * Executes the SQL statements for bulk DQL DELETE statements on classes in * Class Table Inheritance (JOINED). @@ -32,14 +34,14 @@ * (org.hibernate.hql.ast.exec.MultiTableDeleteExecutor). * @todo Rename to MultiTableDeleteExecutor */ -class Doctrine_ORM_Query_SqlExecutor_MultiTableDelete extends Doctrine_ORM_Query_SqlExecutor_Abstract +class MultiTableDeleteExecutor extends AbstractExecutor { /** * Enter description here... * * @param Doctrine_ORM_Query_AST $AST */ - public function __construct(Doctrine_ORM_Query_AST $AST) + public function __construct(\Doctrine\ORM\Query\AST $AST) { // TODO: Inspect the AST, create the necessary SQL queries and store them // in $this->_sqlStatements @@ -52,7 +54,7 @@ public function __construct(Doctrine_ORM_Query_AST $AST) * @param array $params The parameters. * @override */ - public function execute(Doctrine_Connection $conn, array $params) + public function execute(\Doctrine\DBAL\Connection $conn, array $params) { //... } diff --git a/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php b/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php index 11673ac4dce..8f022c6df7e 100644 --- a/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php +++ b/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Exec; + /** * Executes the SQL statements for bulk DQL UPDATE statements on classes in * Class Table Inheritance (JOINED). @@ -32,9 +34,9 @@ * (org.hibernate.hql.ast.exec.MultiTableUpdateExecutor). * @todo Rename to MultiTableUpdateExecutor */ -class Doctrine_ORM_Query_SqlExecutor_MultiTableUpdate extends Doctrine_ORM_Query_SqlExecutor_Abstract +class MultiTableUpdateExecutor extends AbstractExecutor { - public function __construct(Doctrine_ORM_Query_AST $AST) + public function __construct(\Doctrine\ORM\Query\AST $AST) { // TODO: Inspect the AST, create the necessary SQL queries and store them // in $this->_sqlStatements @@ -47,7 +49,7 @@ public function __construct(Doctrine_ORM_Query_AST $AST) * @param array $params The parameters. * @override */ - public function execute(Doctrine_Connection $conn, array $params) + public function execute(\Doctrine\DBAL\Connection $conn, array $params) { //... } diff --git a/lib/Doctrine/ORM/Query/Lexer.php b/lib/Doctrine/ORM/Query/Lexer.php index a7c4868b44f..c4ca0315195 100644 --- a/lib/Doctrine/ORM/Query/Lexer.php +++ b/lib/Doctrine/ORM/Query/Lexer.php @@ -281,4 +281,4 @@ public function resetPosition($position = 0) { $this->_position = $position; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index cdddc44814a..e1d0b256098 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -117,7 +117,6 @@ public function __construct(\Doctrine\ORM\Query $query) $this->free(true); } - /** * Attempts to match the given token with the current lookahead token. * @@ -173,7 +172,6 @@ public function free($deep = false, $position = 0) //$this->_errorDistance = self::MIN_ERROR_DISTANCE; } - /** * Parses a query string. */ @@ -1288,4 +1286,4 @@ private function _StringPrimary() $this->syntaxError('StateFieldPathExpression | string | InputParameter | FunctionsReturningStrings | AggregateExpression'); } } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser/AbstractSchemaName.php b/lib/Doctrine/ORM/Query/Parser/AbstractSchemaName.php index 5b40e1930c7..3abf47dd12a 100644 --- a/lib/Doctrine/ORM/Query/Parser/AbstractSchemaName.php +++ b/lib/Doctrine/ORM/Query/Parser/AbstractSchemaName.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * AbstractSchemaName ::= identifier * @@ -29,19 +31,17 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_AbstractSchemaName extends Doctrine_ORM_Query_ParserRule +class AbstractSchemaName extends \Doctrine\ORM\Query\ParserRule { protected $_componentName = null; - - + public function syntax() { // AbstractSchemaName ::= identifier - $this->_parser->match(Doctrine_ORM_Query_Token::T_IDENTIFIER); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_IDENTIFIER); $this->_componentName = $this->_parser->token['value']; } - public function semantical() { // Check if we are dealing with a real Doctrine_Entity or not @@ -55,9 +55,8 @@ public function semantical() return $this->_componentName; } - protected function _isDoctrineEntity($componentName) { - return class_exists($componentName)/* && class_implements($componentName, 'Doctrine_ORM_Entity')*/; + return class_exists($componentName); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser/AliasIdentificationVariable.php b/lib/Doctrine/ORM/Query/Parser/AliasIdentificationVariable.php index eca986a1c15..d0df6fd6680 100644 --- a/lib/Doctrine/ORM/Query/Parser/AliasIdentificationVariable.php +++ b/lib/Doctrine/ORM/Query/Parser/AliasIdentificationVariable.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * AliasIdentificationVariable = identifier * @@ -29,15 +31,14 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_AliasIdentificationVariable extends Doctrine_ORM_Query_ParserRule +class AliasIdentificationVariable extends \Doctrine\ORM\Query\ParserRule { protected $_componentAlias = null; - public function syntax() { // AliasIdentificationVariable = identifier - $this->_parser->match(Doctrine_ORM_Query_Token::T_IDENTIFIER); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_IDENTIFIER); $this->_componentAlias = $this->_parser->token['value']; } diff --git a/lib/Doctrine/ORM/Query/Parser/CollectionValuedAssociationField.php b/lib/Doctrine/ORM/Query/Parser/CollectionValuedAssociationField.php index 1f66c7d83a7..5e48f6419ff 100644 --- a/lib/Doctrine/ORM/Query/Parser/CollectionValuedAssociationField.php +++ b/lib/Doctrine/ORM/Query/Parser/CollectionValuedAssociationField.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * CollectionValuedAssociationField ::= FieldIdentificationVariable * @@ -29,5 +31,6 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_CollectionValuedAssociationField extends Doctrine_ORM_Query_Parser_FieldIdentificationVariable -{ } \ No newline at end of file +class CollectionValuedAssociationField extends FieldIdentificationVariable +{ +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser/DeleteStatement.php b/lib/Doctrine/ORM/Query/Parser/DeleteStatement.php index a37ecc2dd80..2d64e40389a 100644 --- a/lib/Doctrine/ORM/Query/Parser/DeleteStatement.php +++ b/lib/Doctrine/ORM/Query/Parser/DeleteStatement.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * DeleteStatement ::= DeleteClause [WhereClause] * @@ -29,7 +31,7 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_DeleteStatement extends Doctrine_ORM_Query_ParserRule +class DeleteStatement extends \Doctrine\ORM\Query\ParserRule { public function syntax() { @@ -38,7 +40,7 @@ public function syntax() $AST->setDeleteClause($this->parse('DeleteClause')); - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_WHERE)) { + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_WHERE)) { $AST->setWhereClause($this->parse('WhereClause')); } diff --git a/lib/Doctrine/ORM/Query/Parser/EmbeddedClassStateField.php b/lib/Doctrine/ORM/Query/Parser/EmbeddedClassStateField.php index d033c7a4c3e..8a423229fd8 100644 --- a/lib/Doctrine/ORM/Query/Parser/EmbeddedClassStateField.php +++ b/lib/Doctrine/ORM/Query/Parser/EmbeddedClassStateField.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * EmbeddedClassStateField ::= FieldIdentificationVariable * @@ -29,5 +31,6 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_EmbeddedClassStateField extends Doctrine_ORM_Query_Parser_FieldIdentificationVariable -{ } \ No newline at end of file +class EmbeddedClassStateField extends FieldIdentificationVariable +{ +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser/Exception.php b/lib/Doctrine/ORM/Query/Parser/Exception.php deleted file mode 100644 index a760fd4b664..00000000000 --- a/lib/Doctrine/ORM/Query/Parser/Exception.php +++ /dev/null @@ -1,35 +0,0 @@ -. - */ - -/** - * Doctrine_ORM_Query_Parser_Exception - * - * @package Doctrine - * @subpackage Query - * @author Janne Vanhala - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @link http://www.phpdoctrine.org - * @since 1.0 - * @version $Revision$ - */ -class Doctrine_ORM_Query_Parser_Exception extends Doctrine_ORM_Query_Exception -{ -} diff --git a/lib/Doctrine/ORM/Query/Parser/FieldAliasIdentificationVariable.php b/lib/Doctrine/ORM/Query/Parser/FieldAliasIdentificationVariable.php index 6804d30ea08..4600e309774 100644 --- a/lib/Doctrine/ORM/Query/Parser/FieldAliasIdentificationVariable.php +++ b/lib/Doctrine/ORM/Query/Parser/FieldAliasIdentificationVariable.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * FieldAliasIdentificationVariable ::= identifier * @@ -29,7 +31,7 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_FieldAliasIdentificationVariable extends Doctrine_ORM_Query_Parser +class FieldAliasIdentificationVariable extends \Doctrine\ORM\Query\Parser { protected $_fieldAlias = null; @@ -37,7 +39,7 @@ class Doctrine_ORM_Query_Parser_FieldAliasIdentificationVariable extends Doctrin public function syntax() { // AliasIdentificationVariable = identifier - $this->_parser->match(Doctrine_ORM_Query_Token::T_IDENTIFIER); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_IDENTIFIER); $this->_fieldAlias = $this->_parser->token['value']; } diff --git a/lib/Doctrine/ORM/Query/Parser/FieldIdentificationVariable.php b/lib/Doctrine/ORM/Query/Parser/FieldIdentificationVariable.php index d25acff4092..6cbbc1e2eb4 100644 --- a/lib/Doctrine/ORM/Query/Parser/FieldIdentificationVariable.php +++ b/lib/Doctrine/ORM/Query/Parser/FieldIdentificationVariable.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * FieldIdentificationVariable ::= identifier * @@ -29,11 +31,11 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_FieldIdentificationVariable extends Doctrine_ORM_Query_ParserRule +class FieldIdentificationVariable extends \Doctrine\ORM\Query\ParserRule { public function syntax() { - $this->_parser->match(Doctrine_ORM_Query_Token::T_IDENTIFIER); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_IDENTIFIER); return $this->_parser->token['value']; } diff --git a/lib/Doctrine/ORM/Query/Parser/FromClause.php b/lib/Doctrine/ORM/Query/Parser/FromClause.php index 62e273e8422..053d91a275e 100644 --- a/lib/Doctrine/ORM/Query/Parser/FromClause.php +++ b/lib/Doctrine/ORM/Query/Parser/FromClause.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration} * @@ -29,17 +31,16 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_FromClause extends Doctrine_ORM_Query_ParserRule +class FromClause extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - public function syntax() { // FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration} $this->_AST = $this->AST('FromClause'); - $this->_parser->match(Doctrine_ORM_Query_Token::T_FROM); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_FROM); $this->_AST->addIdentificationVariableDeclaration( $this->parse('IdentificationVariableDeclaration') diff --git a/lib/Doctrine/ORM/Query/Parser/IdentificationVariable.php b/lib/Doctrine/ORM/Query/Parser/IdentificationVariable.php index 4568dbeab02..422421957dd 100644 --- a/lib/Doctrine/ORM/Query/Parser/IdentificationVariable.php +++ b/lib/Doctrine/ORM/Query/Parser/IdentificationVariable.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * IdentificationVariable ::= identifier * @@ -29,11 +31,10 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_IdentificationVariable extends Doctrine_ORM_Query_ParserRule +class IdentificationVariable extends \Doctrine\ORM\Query\ParserRule { protected $_componentAlias = null; - public function syntax() { // IdentificationVariable ::= identifier @@ -41,7 +42,6 @@ public function syntax() $this->_componentAlias = $this->_parser->token['value']; } - public function semantical() { $parserResult = $this->_parser->getParserResult(); @@ -57,4 +57,4 @@ public function semantical() // Return Component Alias identifier return $this->_componentAlias; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser/IdentificationVariableDeclaration.php b/lib/Doctrine/ORM/Query/Parser/IdentificationVariableDeclaration.php index b000e7f4dff..5b7d5b12872 100644 --- a/lib/Doctrine/ORM/Query/Parser/IdentificationVariableDeclaration.php +++ b/lib/Doctrine/ORM/Query/Parser/IdentificationVariableDeclaration.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}* * @@ -29,7 +31,7 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_IdentificationVariableDeclaration extends Doctrine_ORM_Query_ParserRule +class IdentificationVariableDeclaration extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; @@ -41,14 +43,14 @@ public function syntax() $this->_AST->setRangeVariableDeclaration($this->parse('RangeVariableDeclaration')); - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_INDEX)) { + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_INDEX)) { $this->_AST->setIndexBy($this->parse('IndexBy')); } while ( - $this->_isNextToken(Doctrine_ORM_Query_Token::T_LEFT) || - $this->_isNextToken(Doctrine_ORM_Query_Token::T_INNER) || - $this->_isNextToken(Doctrine_ORM_Query_Token::T_JOIN) + $this->_isNextToken(\Doctrine\ORM\Query\Token::T_LEFT) || + $this->_isNextToken(\Doctrine\ORM\Query\Token::T_INNER) || + $this->_isNextToken(\Doctrine\ORM\Query\Token::T_JOIN) ) { $this->_AST->addJoinVariableDeclaration($this->parse('JoinVariableDeclaration')); } diff --git a/lib/Doctrine/ORM/Query/Parser/IndexBy.php b/lib/Doctrine/ORM/Query/Parser/IndexBy.php index 2e1c233b88b..0c72b795adf 100644 --- a/lib/Doctrine/ORM/Query/Parser/IndexBy.php +++ b/lib/Doctrine/ORM/Query/Parser/IndexBy.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * IndexBy ::= "INDEX" "BY" SimpleStateFieldPathExpression * @@ -29,23 +31,21 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_IndexBy extends Doctrine_ORM_Query_ParserRule +class IndexBy extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - public function syntax() { // IndexBy ::= "INDEX" "BY" SimpleStateFieldPathExpression $this->_AST = $this->AST('IndexBy'); - $this->_parser->match(Doctrine_ORM_Query_Token::T_INDEX); - $this->_parser->match(Doctrine_ORM_Query_Token::T_BY); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_INDEX); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_BY); $this->_AST->setSimpleStateFieldPathExpression($this->parse('SimpleStateFieldPathExpression')); } - public function semantical() { // Retrieving required information diff --git a/lib/Doctrine/ORM/Query/Parser/Join.php b/lib/Doctrine/ORM/Query/Parser/Join.php index a3d8b227aee..b87a1b8f693 100644 --- a/lib/Doctrine/ORM/Query/Parser/Join.php +++ b/lib/Doctrine/ORM/Query/Parser/Join.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression * ["AS"] AliasIdentificationVariable [("ON" | "WITH") ConditionalExpression] @@ -29,11 +31,10 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_Join extends Doctrine_ORM_Query_ParserRule +class Join extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - public function syntax() { // Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression @@ -41,45 +42,45 @@ public function syntax() $this->_AST = $this->AST('Join'); // Check Join type - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_LEFT)) { - $this->_parser->match(Doctrine_ORM_Query_Token::T_LEFT); + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_LEFT)) { + $this->_parser->match(\Doctrine\ORM\Query\Token::T_LEFT); // Possible LEFT OUTER join - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_OUTER)) { - $this->_parser->match(Doctrine_ORM_Query_Token::T_OUTER); + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_OUTER)) { + $this->_parser->match(\Doctrine\ORM\Query\Token::T_OUTER); $this->_AST->setJoinType(Doctrine_ORM_Query_AST_Join::JOIN_TYPE_LEFTOUTER); } else { $this->_AST->setJoinType(Doctrine_ORM_Query_AST_Join::JOIN_TYPE_LEFT); } - } else if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_INNER)) { + } else if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_INNER)) { // Default Join type. Not need to setJoinType. - $this->_parser->match(Doctrine_ORM_Query_Token::T_INNER); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_INNER); } - $this->_parser->match(Doctrine_ORM_Query_Token::T_JOIN); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_JOIN); $this->_AST->setJoinAssociationPathExpression($this->parse('JoinAssociationPathExpression')); - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_AS)) { - $this->_parser->match(Doctrine_ORM_Query_Token::T_AS); + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_AS)) { + $this->_parser->match(\Doctrine\ORM\Query\Token::T_AS); } $this->_AST->setAliasIdentificationVariable($this->parse('AliasIdentificationVariable')); // Check Join where type if ( - $this->_isNextToken(Doctrine_ORM_Query_Token::T_ON) || - $this->_isNextToken(Doctrine_ORM_Query_Token::T_WITH) + $this->_isNextToken(\Doctrine\ORM\Query\Token::T_ON) || + $this->_isNextToken(\Doctrine\ORM\Query\Token::T_WITH) ) { // Apply matches and adjusts - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_ON)) { - $this->_parser->match(Doctrine_ORM_Query_Token::T_ON); + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_ON)) { + $this->_parser->match(\Doctrine\ORM\Query\Token::T_ON); $this->_AST->setWhereType(Doctrine_ORM_Query_AST_Join::JOIN_WHERE_ON); } else { // Default Join where type. Not need to setWhereType. - $this->_parser->match(Doctrine_ORM_Query_Token::T_WITH); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_WITH); } $this->_AST->setConditionalExpression($this->parse('ConditionalExpression')); diff --git a/lib/Doctrine/ORM/Query/Parser/JoinAssociationPathExpression.php b/lib/Doctrine/ORM/Query/Parser/JoinAssociationPathExpression.php index d1552fd2db2..bd0b718e077 100644 --- a/lib/Doctrine/ORM/Query/Parser/JoinAssociationPathExpression.php +++ b/lib/Doctrine/ORM/Query/Parser/JoinAssociationPathExpression.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * JoinAssociationPathExpression ::= JoinCollectionValuedPathExpression | JoinSingleValuedAssociationPathExpression * @@ -29,7 +31,7 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_JoinAssociationPathExpression extends Doctrine_ORM_Query_ParserRule +class JoinAssociationPathExpression extends \Doctrine\ORM\Query\ParserRule { public function syntax() { @@ -40,7 +42,6 @@ public function syntax() ); } - private function _isSingleValuedPathExpression() { $parserResult = $this->_parser->getParserResult(); @@ -55,7 +56,7 @@ private function _isSingleValuedPathExpression() $token = $this->_parser->getScanner()->peek(); // If we have a dot ".", then next char must be the "*" - if ($token['type'] === Doctrine_ORM_Query_Token::T_DOT) { + if ($token['type'] === \Doctrine\ORM\Query\Token::T_DOT) { $token = $this->_parser->getScanner()->peek(); if ( ! ($queryComponent['metadata']->hasAssociation($token['value']) && @@ -67,4 +68,4 @@ private function _isSingleValuedPathExpression() return false; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser/JoinCollectionValuedPathExpression.php b/lib/Doctrine/ORM/Query/Parser/JoinCollectionValuedPathExpression.php index 7dd387ef06b..25567c92cb5 100644 --- a/lib/Doctrine/ORM/Query/Parser/JoinCollectionValuedPathExpression.php +++ b/lib/Doctrine/ORM/Query/Parser/JoinCollectionValuedPathExpression.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * JoinCollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField * @@ -29,22 +31,20 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_JoinCollectionValuedPathExpression extends Doctrine_ORM_Query_ParserRule +class JoinCollectionValuedPathExpression extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - public function syntax() { // JoinCollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField $this->_AST = $this->AST('JoinCollectionValuedPathExpression'); $this->_AST->setIdentificationVariable($this->parse('IdentificationVariable')); - $this->_parser->match(Doctrine_ORM_Query_Token::T_DOT); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_DOT); $this->_AST->setCollectionValuedAssociationField($this->parse('CollectionValuedAssociationField')); } - public function semantical() { $parserResult = $this->_parser->getParserResult(); @@ -71,4 +71,4 @@ public function semantical() return $this->_AST; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser/JoinSingleValuedAssociationPathExpression.php b/lib/Doctrine/ORM/Query/Parser/JoinSingleValuedAssociationPathExpression.php index e0262267abe..213b4679db3 100644 --- a/lib/Doctrine/ORM/Query/Parser/JoinSingleValuedAssociationPathExpression.php +++ b/lib/Doctrine/ORM/Query/Parser/JoinSingleValuedAssociationPathExpression.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * JoinSingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField * @@ -29,22 +31,20 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_JoinSingleValuedAssociationPathExpression extends Doctrine_ORM_Query_ParserRule +class JoinSingleValuedAssociationPathExpression extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - public function syntax() { // JoinSingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField $this->_AST = $this->AST('JoinSingleValuedAssociationPathExpression'); $this->_AST->setIdentificationVariable($this->parse('IdentificationVariable')); - $this->_parser->match(Doctrine_ORM_Query_Token::T_DOT); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_DOT); $this->_AST->setSingleValuedAssociationField($this->parse('SingleValuedAssociationField')); } - public function semantical() { $parserResult = $this->_parser->getParserResult(); diff --git a/lib/Doctrine/ORM/Query/Parser/JoinVariableDeclaration.php b/lib/Doctrine/ORM/Query/Parser/JoinVariableDeclaration.php index 38eef8723ce..30a1d35b01f 100644 --- a/lib/Doctrine/ORM/Query/Parser/JoinVariableDeclaration.php +++ b/lib/Doctrine/ORM/Query/Parser/JoinVariableDeclaration.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * JoinVariableDeclaration ::= Join [IndexBy] * @@ -29,11 +31,10 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_JoinVariableDeclaration extends Doctrine_ORM_Query_ParserRule +class JoinVariableDeclaration extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - public function syntax() { // JoinVariableDeclaration ::= Join [IndexBy] @@ -41,12 +42,11 @@ public function syntax() $this->_AST->setJoin($this->parse('Join')); - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_INDEX)) { + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_INDEX)) { $this->_AST->setIndexBy($this->parse('IndexBy')); } } - public function semantical() { // If we have an INDEX BY JoinVariableDeclaration diff --git a/lib/Doctrine/ORM/Query/Parser/QueryLanguage.php b/lib/Doctrine/ORM/Query/Parser/QueryLanguage.php index c1312a45600..f4a806744e4 100644 --- a/lib/Doctrine/ORM/Query/Parser/QueryLanguage.php +++ b/lib/Doctrine/ORM/Query/Parser/QueryLanguage.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement * @@ -31,21 +33,21 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_QueryLanguage extends Doctrine_ORM_Query_ParserRule +class QueryLanguage extends \Doctrine\ORM\Query\ParserRule { public function syntax() { // QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement switch ($this->_parser->lookahead['type']) { - case Doctrine_ORM_Query_Token::T_SELECT: + case \Doctrine\ORM\Query\Token::T_SELECT: return $this->parse('SelectStatement'); break; - case Doctrine_ORM_Query_Token::T_UPDATE: + case \Doctrine\ORM\Query\Token::T_UPDATE: return $this->parse('UpdateStatement'); break; - case Doctrine_ORM_Query_Token::T_DELETE: + case \Doctrine\ORM\Query\Token::T_DELETE: return $this->parse('DeleteStatement'); break; diff --git a/lib/Doctrine/ORM/Query/Parser/RangeVariableDeclaration.php b/lib/Doctrine/ORM/Query/Parser/RangeVariableDeclaration.php index 3545db7d969..7ef810ef44c 100644 --- a/lib/Doctrine/ORM/Query/Parser/RangeVariableDeclaration.php +++ b/lib/Doctrine/ORM/Query/Parser/RangeVariableDeclaration.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable * @@ -29,11 +31,10 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_RangeVariableDeclaration extends Doctrine_ORM_Query_ParserRule +class RangeVariableDeclaration extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - public function syntax() { // RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable @@ -41,14 +42,13 @@ public function syntax() $this->_AST->setAbstractSchemaName($this->parse('AbstractSchemaName')); - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_AS)) { - $this->_parser->match(Doctrine_ORM_Query_Token::T_AS); + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_AS)) { + $this->_parser->match(\Doctrine\ORM\Query\Token::T_AS); } $this->_AST->setAliasIdentificationVariable($this->parse('AliasIdentificationVariable')); } - public function semantical() { $parserResult = $this->_parser->getParserResult(); diff --git a/lib/Doctrine/ORM/Query/Parser/SelectClause.php b/lib/Doctrine/ORM/Query/Parser/SelectClause.php index d0007bc9389..dbf41829d62 100644 --- a/lib/Doctrine/ORM/Query/Parser/SelectClause.php +++ b/lib/Doctrine/ORM/Query/Parser/SelectClause.php @@ -32,20 +32,18 @@ class Doctrine_ORM_Query_Parser_SelectClause extends Doctrine_ORM_Query_ParserRule { protected $_AST = null; - protected $_selectExpressions = array(); - public function syntax() { // SelectClause ::= "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression} $this->_AST = $this->AST('SelectClause'); - $this->_parser->match(Doctrine_ORM_Query_Token::T_SELECT); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_SELECT); // Inspecting if we are in a DISTINCT query - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_DISTINCT)) { - $this->_parser->match(Doctrine_ORM_Query_Token::T_DISTINCT); + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_DISTINCT)) { + $this->_parser->match(\Doctrine\ORM\Query\Token::T_DISTINCT); $this->_AST->setIsDistinct(true); } @@ -53,14 +51,13 @@ public function syntax() // Process SelectExpressions (1..N) $this->_selectExpressions[] = $this->parse('SelectExpression'); - while ($this->_isNextToken(Doctrine_ORM_Query_Token::T_COMMA)) { - $this->_parser->match(Doctrine_ORM_Query_Token::T_COMMA); + while ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_COMMA)) { + $this->_parser->match(\Doctrine\ORM\Query\Token::T_COMMA); $this->_selectExpressions[] = $this->parse('SelectExpression'); } } - public function semantical() { // We need to validate each SelectExpression @@ -71,4 +68,4 @@ public function semantical() // Return AST node return $this->_AST; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser/SelectExpression.php b/lib/Doctrine/ORM/Query/Parser/SelectExpression.php index ae944d00663..49114640638 100644 --- a/lib/Doctrine/ORM/Query/Parser/SelectExpression.php +++ b/lib/Doctrine/ORM/Query/Parser/SelectExpression.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * SelectExpression ::= IdentificationVariable ["." "*"] | StateFieldPathExpression | * (AggregateExpression | "(" Subselect ")") [["AS"] FieldAliasIdentificationVariable] @@ -30,15 +32,12 @@ * @since 1.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_SelectExpression extends Doctrine_ORM_Query_ParserRule +class SelectExpression extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - protected $_expression = null; - protected $_fieldIdentificationVariable = null; - public function syntax() { // SelectExpression ::= IdentificationVariable ["." "*"] | StateFieldPathExpression | @@ -57,11 +56,11 @@ public function syntax() } else if (($isFunction = $this->_isFunction()) !== false || $this->_isSubselect()) { $this->_expression = $this->parse($isFunction ? 'AggregateExpression' : 'Subselect'); - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_AS)) { - $this->_parser->match(Doctrine_ORM_Query_Token::T_AS); + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_AS)) { + $this->_parser->match(\Doctrine\ORM\Query\Token::T_AS); $this->_fieldIdentificationVariable = $this->parse('FieldAliasIdentificationVariable'); - } elseif ($this->_isNextToken(Doctrine_ORM_Query_Token::T_IDENTIFIER)) { + } elseif ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_IDENTIFIER)) { $this->_fieldIdentificationVariable = $this->parse('FieldAliasIdentificationVariable'); } } else { @@ -69,7 +68,6 @@ public function syntax() } } - public function semantical() { $this->_AST->setExpression($this->_expression->semantical()); @@ -82,7 +80,6 @@ public function semantical() return $this->_AST; } - protected function _isIdentificationVariable() { // Trying to recoginize this grammar: IdentificationVariable ["." "*"] @@ -90,7 +87,7 @@ protected function _isIdentificationVariable() $this->_parser->getScanner()->resetPeek(); // We have an identifier here - if ($token['type'] === Doctrine_ORM_Query_Token::T_IDENTIFIER) { + if ($token['type'] === \Doctrine\ORM\Query\Token::T_IDENTIFIER) { return true; } diff --git a/lib/Doctrine/ORM/Query/Parser/SelectStatement.php b/lib/Doctrine/ORM/Query/Parser/SelectStatement.php index 2b1dff3fb15..62b0ec66cc4 100644 --- a/lib/Doctrine/ORM/Query/Parser/SelectStatement.php +++ b/lib/Doctrine/ORM/Query/Parser/SelectStatement.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause] * @@ -29,13 +31,11 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_SelectStatement extends Doctrine_ORM_Query_ParserRule +class SelectStatement extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - protected $_selectClause = null; - public function syntax() { // SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause] @@ -50,24 +50,23 @@ public function syntax() $this->_AST->setFromClause($this->parse('FromClause')); - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_WHERE)) { + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_WHERE)) { $this->_AST->setWhereClause($this->parse('WhereClause')); } - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_GROUP)) { + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_GROUP)) { $this->_AST->setGroupByClause($this->parse('GroupByClause')); } - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_HAVING)) { + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_HAVING)) { $this->_AST->setHavingClause($this->parse('HavingClause')); } - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_ORDER)) { + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_ORDER)) { $this->_AST->setOrderByClause($this->parse('OrderByClause')); } } - public function semantical() { // We need to invoke the semantical check of SelectClause here, since diff --git a/lib/Doctrine/ORM/Query/Parser/SimpleStateField.php b/lib/Doctrine/ORM/Query/Parser/SimpleStateField.php index 7e063164747..b76457f0731 100644 --- a/lib/Doctrine/ORM/Query/Parser/SimpleStateField.php +++ b/lib/Doctrine/ORM/Query/Parser/SimpleStateField.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * SimpleStateField ::= FieldIdentificationVariable * @@ -29,5 +31,6 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_SimpleStateField extends Doctrine_ORM_Query_Parser_FieldIdentificationVariable -{ } \ No newline at end of file +class SimpleStateField extends \Doctrine\ORM\Query\Parser\FieldIdentificationVariable +{ +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser/SimpleStateFieldPathExpression.php b/lib/Doctrine/ORM/Query/Parser/SimpleStateFieldPathExpression.php index 05eaf020a8a..5d346449de5 100644 --- a/lib/Doctrine/ORM/Query/Parser/SimpleStateFieldPathExpression.php +++ b/lib/Doctrine/ORM/Query/Parser/SimpleStateFieldPathExpression.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * SimpleStateFieldPathExpression ::= IdentificationVariable "." SimpleStateField * @@ -29,11 +31,10 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_SimpleStateFieldPathExpression extends Doctrine_ORM_Query_ParserRule +class SimpleStateFieldPathExpression extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - - + public function syntax() { // SimpleStateFieldPathExpression ::= IdentificationVariable "." SimpleStateField @@ -46,7 +47,6 @@ public function syntax() $this->_AST->setSimpleStateField($this->parse('SimpleStateField')); } - public function semantical() { $parserResult = $this->_parser->getParserResult(); @@ -63,7 +63,7 @@ public function semantical() return; } - if ($classMetadata instanceof Doctrine_ClassMetadata && ! $classMetadata->hasField($componentFieldName)) { + if ($classMetadata instanceof \Doctrine\ORM\Mapping\ClassMetadata && ! $classMetadata->hasField($componentFieldName)) { $this->_parser->semanticalError( "Cannot use key mapping. Field '" . $componentFieldName . "' " . "does not exist in component '" . $classMetadata->getClassName() . "'.", diff --git a/lib/Doctrine/ORM/Query/Parser/SingleValuedAssociationField.php b/lib/Doctrine/ORM/Query/Parser/SingleValuedAssociationField.php index 0211888021f..8a7a46af5ae 100644 --- a/lib/Doctrine/ORM/Query/Parser/SingleValuedAssociationField.php +++ b/lib/Doctrine/ORM/Query/Parser/SingleValuedAssociationField.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * SingleValuedAssociationField ::= FieldIdentificationVariable * @@ -29,5 +31,6 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_SingleValuedAssociationField extends Doctrine_ORM_Query_Parser_FieldIdentificationVariable -{ } \ No newline at end of file +class SingleValuedAssociationField extends \Doctrine\ORM\Query\Parser\FieldIdentificationVariable +{ +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Parser/StateField.php b/lib/Doctrine/ORM/Query/Parser/StateField.php index 4f3a5738705..8596e740a28 100644 --- a/lib/Doctrine/ORM/Query/Parser/StateField.php +++ b/lib/Doctrine/ORM/Query/Parser/StateField.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * StateField ::= {EmbeddedClassStateField "."}* SimpleStateField * @@ -29,20 +31,19 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_StateField extends Doctrine_ORM_Query_ParserRule +class StateField extends \Doctrine\ORM\Query\ParserRule { protected $_AST = null; - public function syntax() { // StateField ::= {EmbeddedClassStateField "."}* SimpleStateField $this->_AST = $this->AST('StateField'); - while ($this->_parser->lookahead['type'] == Doctrine_ORM_Query_Token::T_IDENTIFIER && - $this->_isNextToken(Doctrine_ORM_Query_Token::T_DOT)) { + while ($this->_parser->lookahead['type'] == \Doctrine\ORM\Query\Token::T_IDENTIFIER && + $this->_isNextToken(\Doctrine\ORM\Query\Token::T_DOT)) { $this->_AST->addEmbeddedClassStateField($this->parse('EmbeddedClassStateField')); - $this->_parser->match(Doctrine_ORM_Query_Token::T_DOT); + $this->_parser->match(\Doctrine\ORM\Query\Token::T_DOT); } $this->_AST->setSimpleStateField($this->parse('SimpleStateField')); diff --git a/lib/Doctrine/ORM/Query/Parser/UpdateStatement.php b/lib/Doctrine/ORM/Query/Parser/UpdateStatement.php index f6a74dcea16..069bcb2072b 100644 --- a/lib/Doctrine/ORM/Query/Parser/UpdateStatement.php +++ b/lib/Doctrine/ORM/Query/Parser/UpdateStatement.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query\Parser; + /** * UpdateStatement ::= UpdateClause [WhereClause] * @@ -29,7 +31,7 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Parser_UpdateStatement extends Doctrine_ORM_Query_ParserRule +class UpdateStatement extends \Doctrine\ORM\Query\ParserRule { public function syntax() { @@ -38,11 +40,11 @@ public function syntax() $AST->setUpdateClause($this->parse('UpdateClause')); - if ($this->_isNextToken(Doctrine_ORM_Query_Token::T_WHERE)) { + if ($this->_isNextToken(\Doctrine\ORM\Query\Token::T_WHERE)) { $AST->setWhereClause($this->parse('WhereClause')); } // Return AST node return $AST; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/ParserDataHolder.php b/lib/Doctrine/ORM/Query/ParserDataHolder.php index 6eb80b71c10..b835c86eeea 100644 --- a/lib/Doctrine/ORM/Query/ParserDataHolder.php +++ b/lib/Doctrine/ORM/Query/ParserDataHolder.php @@ -33,16 +33,13 @@ class Doctrine_ORM_Query_ParserDataHolder { protected static $_instance; - protected $_data; - protected function __construct() { $this->free(); } - public static function create() { if ( ! isset(self::$_instance)) { @@ -52,31 +49,26 @@ public static function create() return self::$_instance; } - public function free() { $this->_data = array(); } - public function set($offset, $value) { $this->_data[$offset] = $value; } - public function get($offset) { return isset($this->_data[$offset]) ? $this->_data[$offset] : null; } - public function has($offset) { return isset($this->_data[$offset]); } - public function remove($offset) { if ($this->has($offset)) { @@ -84,4 +76,4 @@ public function remove($offset) unset($this->_data[$offset]); } } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/ParserResult.php b/lib/Doctrine/ORM/Query/ParserResult.php index a2b052fa1a2..66b21e100d4 100644 --- a/lib/Doctrine/ORM/Query/ParserResult.php +++ b/lib/Doctrine/ORM/Query/ParserResult.php @@ -47,7 +47,6 @@ class ParserResult extends AbstractResult */ protected $_queryFields = array(); - /** * Sets the Entity Manager. * @@ -58,7 +57,6 @@ public function setEntityManager($em) $this->_em = $em; } - /** * Gets the Entity Manager. * @@ -69,7 +67,6 @@ public function getEntityManager() return $this->_em; } - /** * @nodoc */ @@ -78,7 +75,6 @@ public function setSqlExecutor(\Doctrine\ORM\Query\Exec\AbstractExecutor $execut $this->_data = $executor; } - /** * @nodoc */ @@ -87,7 +83,6 @@ public function getSqlExecutor() return $this->_data; } - /** * Defines the mapping fields. * @@ -98,7 +93,6 @@ public function setQueryFields(array $queryFields) $this->_queryFields = $queryFields; } - /** * Sets the declaration for given field alias. * @@ -110,7 +104,6 @@ public function setQueryField($fieldAlias, $queryField) $this->_queryFields[$fieldAlias] = $queryField; } - /** * Gets the mapping fields. * @@ -121,7 +114,6 @@ public function getQueryFields() return $this->_queryFields; } - /** * Get the declaration for given field alias. * @@ -137,7 +129,6 @@ public function getQueryField($fieldAlias) return $this->_queryFields[$fieldAlias]; } - /** * Whether or not this object has a declaration for given field alias. * @@ -148,4 +139,4 @@ public function hasQueryField($fieldAlias) { return isset($this->_queryFields[$fieldAlias]); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/ParserResultDummy.php b/lib/Doctrine/ORM/Query/ParserResultDummy.php index 3261252de7b..736b7709525 100644 --- a/lib/Doctrine/ORM/Query/ParserResultDummy.php +++ b/lib/Doctrine/ORM/Query/ParserResultDummy.php @@ -16,7 +16,6 @@ class ParserResultDummy private $_tableToClassAliasMap; private $_queryComponents; - public function isMixedQuery() { return $this->_isMixedQuery; @@ -76,7 +75,4 @@ public function getQueryComponents() { return $this->_queryComponents; } -} - - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/ParserRule.php b/lib/Doctrine/ORM/Query/ParserRule.php index 31cef97f552..6110b893b91 100644 --- a/lib/Doctrine/ORM/Query/ParserRule.php +++ b/lib/Doctrine/ORM/Query/ParserRule.php @@ -39,13 +39,11 @@ abstract class ParserRule */ const SQLALIAS_SEPARATOR = '__'; - /** * @nodoc */ const DEFAULT_QUERYCOMPONENT = 'dctrn'; - /** * Parser object * @@ -67,7 +65,6 @@ abstract class ParserRule */ protected $_dataHolder; - /** * Creates a new production object. * @@ -80,14 +77,12 @@ public function __construct(Doctrine_ORM_Query_Parser $parser) $this->_dataHolder = Doctrine_ORM_Query_ParserDataHolder::create(); } - protected function _isNextToken($token) { $la = $this->_parser->lookahead; return ($la['type'] === $token || $la['value'] === $token); } - protected function _isFunction() { $la = $this->_parser->lookahead; @@ -95,7 +90,6 @@ protected function _isFunction() return ($la['type'] === Doctrine_ORM_Query_Token::T_IDENTIFIER && $next['value'] === '('); } - protected function _isSubselect() { $la = $this->_parser->lookahead; @@ -103,7 +97,6 @@ protected function _isSubselect() return ($la['value'] === '(' && $next['type'] === Doctrine_ORM_Query_Token::T_SELECT); } - /** * Executes the grammar rule using the specified parameters. * @@ -142,7 +135,6 @@ public function parse($ruleName) return $BNFGrammarRule; } - /** * Returns a grammar rule object with the given name. * @@ -164,8 +156,7 @@ protected function _getGrammarRule($name) return new $class($this->_parser); } - - + /** * Creates an AST node with the given name. * @@ -183,7 +174,6 @@ public function AST($AstName) */ abstract public function syntax(); - /** * @nodoc */ @@ -200,4 +190,4 @@ public function getDataHolder() { return $this->_dataHolder; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Printer.php b/lib/Doctrine/ORM/Query/Printer.php index 84af04054ad..972ad518f44 100644 --- a/lib/Doctrine/ORM/Query/Printer.php +++ b/lib/Doctrine/ORM/Query/Printer.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query; + /** * A parse tree printer for Doctrine Query Language parser. * @@ -28,7 +30,7 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_Printer +class Printer { /** * Current indentation level @@ -90,4 +92,4 @@ public function println($str) echo str_repeat(' ', $this->_indent), $str, "\n"; } } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Production/AggregateExpression.php b/lib/Doctrine/ORM/Query/Production/AggregateExpression.php index 311dde66a96..bb64bddb8b9 100644 --- a/lib/Doctrine/ORM/Query/Production/AggregateExpression.php +++ b/lib/Doctrine/ORM/Query/Production/AggregateExpression.php @@ -19,6 +19,10 @@ * . */ +namespace Doctrine\ORM\Query\Production; + +use \Doctrine\ORM\Query\Token; + /** * AggregateExpression = ("AVG" | "MAX" | "MIN" | "SUM" | "COUNT") "(" ["DISTINCT"] Expression ")" * @@ -31,15 +35,12 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_Query_Production_AggregateExpression extends Doctrine_Query_Production +class AggregateExpression extends Doctrine_Query_Production { protected $_functionName; - protected $_isDistinct; - protected $_expression; - public function syntax($paramHolder) { // AggregateExpression = ("AVG" | "MAX" | "MIN" | "SUM" | "COUNT") "(" ["DISTINCT"] Expression ")" @@ -47,11 +48,11 @@ public function syntax($paramHolder) $token = $this->_parser->lookahead; switch ($token['type']) { - case Doctrine_Query_Token::T_AVG: - case Doctrine_Query_Token::T_MAX: - case Doctrine_Query_Token::T_MIN: - case Doctrine_Query_Token::T_SUM: - case Doctrine_Query_Token::T_COUNT: + case Token::T_AVG: + case Token::T_MAX: + case Token::T_MIN: + case Token::T_SUM: + case Token::T_COUNT: $this->_parser->match($token['type']); $this->_functionName = strtoupper($token['value']); break; @@ -63,8 +64,8 @@ public function syntax($paramHolder) $this->_parser->match('('); - if ($this->_isNextToken(Doctrine_Query_Token::T_DISTINCT)) { - $this->_parser->match(Doctrine_Query_Token::T_DISTINCT); + if ($this->_isNextToken(Token::T_DISTINCT)) { + $this->_parser->match(Token::T_DISTINCT); $this->_isDistinct = true; } @@ -115,4 +116,4 @@ public function isDistinct() { return $this->_isDistinct; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Production/Factor.php b/lib/Doctrine/ORM/Query/Production/Factor.php index b4d58586130..466e520360a 100644 --- a/lib/Doctrine/ORM/Query/Production/Factor.php +++ b/lib/Doctrine/ORM/Query/Production/Factor.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\Query\Production; + /** * Factor = [("+" | "-")] Primary * @@ -31,13 +33,12 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_Query_Production_Factor extends Doctrine_Query_Production +class Factor extends \Doctrine\Query\Production { protected $_type; protected $_primary; - public function syntax($paramHolder) { // Factor = [("+" | "-")] Primary @@ -57,13 +58,11 @@ public function syntax($paramHolder) } } - public function semantical($paramHolder) { $this->_primary->semantical($paramHolder); } - public function buildSql() { return $this->_type . ' ' . $this->_primary->buildSql(); @@ -91,4 +90,4 @@ public function getPrimary() { return $this->_primary; } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/QueryException.php b/lib/Doctrine/ORM/Query/QueryException.php index 13cf3e6e95b..95e8dd65797 100644 --- a/lib/Doctrine/ORM/Query/QueryException.php +++ b/lib/Doctrine/ORM/Query/QueryException.php @@ -11,7 +11,10 @@ * * @author robo */ -class QueryException extends \Doctrine\Common\DoctrineException { - -} - +class QueryException extends \Doctrine\Common\DoctrineException +{ + public static function nonUniqueResult() + { + return new self("The query contains more than one result."); + } +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/QueryResult.php b/lib/Doctrine/ORM/Query/QueryResult.php index eda2ae343bb..3fd1c550e2d 100644 --- a/lib/Doctrine/ORM/Query/QueryResult.php +++ b/lib/Doctrine/ORM/Query/QueryResult.php @@ -19,6 +19,8 @@ * . */ +namespace Doctrine\ORM\Query; + /** * Doctrine_ORM_Query_QueryResult * @@ -29,7 +31,7 @@ * @since 2.0 * @version $Revision$ */ -class Doctrine_ORM_Query_QueryResult extends Doctrine_ORM_Query_AbstractResult +class QueryResult extends AbstractResult { /** * Returns cached resultset. @@ -40,5 +42,4 @@ public function getResultSet() { return $this->_data; } - -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index a63cc649b87..6b8aa772b49 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -397,5 +397,4 @@ public function generateSqlTableAlias($tableName) { return strtolower(substr($tableName, 0, 1)) . $this->_tableAliasCounter++; } -} - +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/Query/Token.php b/lib/Doctrine/ORM/Query/Token.php index ee330c4c85b..ea886416dae 100644 --- a/lib/Doctrine/ORM/Query/Token.php +++ b/lib/Doctrine/ORM/Query/Token.php @@ -85,25 +85,20 @@ final class Token const T_UPDATE = 143; const T_WHERE = 144; const T_WITH = 145; - const T_TRUE = 146; const T_FALSE = 147; - protected $_keywordsTable; - public function __construct() { } - protected function addKeyword($token, $value) { $this->_keywordsTable[$token] = $value; } - public function getLiteral($token) { if ( ! $this->_keywordsTable) { @@ -159,4 +154,4 @@ public function getLiteral($token) ? $this->_keywordsTable[$token] : (is_string($token) ? $token : ''); } -} +} \ No newline at end of file diff --git a/lib/Doctrine/ORM/VirtualProxy.php b/lib/Doctrine/ORM/VirtualProxy.php index cd90ff8778b..02921de9a5a 100644 --- a/lib/Doctrine/ORM/VirtualProxy.php +++ b/lib/Doctrine/ORM/VirtualProxy.php @@ -89,5 +89,4 @@ public function __unset($prop) $realInstance = $this->_load(); unset($realInstance->$prop); } -} - +} \ No newline at end of file