diff --git a/lib/Doctrine/Access.php b/lib/Doctrine/Access.php index 8f40559f8..1112f1ed6 100644 --- a/lib/Doctrine/Access.php +++ b/lib/Doctrine/Access.php @@ -31,7 +31,9 @@ abstract class Doctrine_Access implements ArrayAccess { /** * setArray + * * @param array $array an array of key => value pairs + * @since 1.0 * @return Doctrine_Access */ public function setArray(array $array) { @@ -42,18 +44,23 @@ abstract class Doctrine_Access implements ArrayAccess { return $this; } /** - * __set -- an alias of set() + * __set an alias of set() + * * @see set, offsetSet * @param $name * @param $value + * @since 1.0 + * @return void */ public function __set($name,$value) { $this->set($name,$value); } /** * __get -- an alias of get() + * * @see get, offsetGet * @param mixed $name + * @since 1.0 * @return mixed */ public function __get($name) { @@ -63,6 +70,8 @@ abstract class Doctrine_Access implements ArrayAccess { * __isset() * * @param string $name + * @since 1.0 + * @return boolean whether or not this object contains $name */ public function __isset($name) { return $this->contains($name); @@ -71,19 +80,21 @@ abstract class Doctrine_Access implements ArrayAccess { * __unset() * * @param string $name + * @since 1.0 + * @return void */ public function __unset($name) { return $this->remove($name); } /** * @param mixed $offset - * @return boolean -- whether or not the data has a field $offset + * @return boolean whether or not this object contains $offset */ public function offsetExists($offset) { return $this->contains($offset); } /** - * offsetGet -- an alias of get() + * offsetGet an alias of get() * @see get, __get * @param mixed $offset * @return mixed diff --git a/lib/Doctrine/Connection/Common.php b/lib/Doctrine/Connection/Common.php index d387c7968..40c79a65e 100644 --- a/lib/Doctrine/Connection/Common.php +++ b/lib/Doctrine/Connection/Common.php @@ -1,4 +1,5 @@ . */ +Doctrine::autoload('Doctrine_Overloadable'); /** * Doctrine_Db_Profiler * diff --git a/lib/Doctrine/EventListener/AccessorInvoker.php b/lib/Doctrine/EventListener/AccessorInvoker.php index 34c7a712c..33cf40859 100644 --- a/lib/Doctrine/EventListener/AccessorInvoker.php +++ b/lib/Doctrine/EventListener/AccessorInvoker.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ - +Doctrine::autoload('Doctrine_EventListener'); /** * Doctrine_EventListener_AccessorInvoker * diff --git a/lib/Doctrine/EventListener/Chain.php b/lib/Doctrine/EventListener/Chain.php index b0ab2c3ea..1975a32c4 100644 --- a/lib/Doctrine/EventListener/Chain.php +++ b/lib/Doctrine/EventListener/Chain.php @@ -19,6 +19,8 @@ * . */ Doctrine::autoload('Doctrine_Access'); + +Doctrine::autoload('Doctrine_EventListener_Interface'); /** * Doctrine_EventListener_Chain * this class represents a chain of different listeners, diff --git a/lib/Doctrine/Export/Sqlite.php b/lib/Doctrine/Export/Sqlite.php index 854d4d37a..7e76e0df7 100644 --- a/lib/Doctrine/Export/Sqlite.php +++ b/lib/Doctrine/Export/Sqlite.php @@ -60,7 +60,7 @@ class Doctrine_Export_Sqlite extends Doctrine_Export { * @throws PDOException * @return void */ - public function createIndex($table, $name, $definition) { + public function createIndex($table, $name, array $definition) { $table = $this->conn->quoteIdentifier($table, true); $name = $this->dbh->getIndexName($name); $query = "CREATE INDEX $name ON $table"; diff --git a/lib/Doctrine/Expression/Mssql.php b/lib/Doctrine/Expression/Mssql.php index 3509c758d..7b145b638 100644 --- a/lib/Doctrine/Expression/Mssql.php +++ b/lib/Doctrine/Expression/Mssql.php @@ -51,7 +51,7 @@ class Doctrine_Expression_Mssql extends Doctrine_Expression { * * @return string to call a function to get a substring */ - public function substring($value, $position = 1, $length = null) { + public function substring($value, $position, $length = null) { if (!is_null($length)) return "SUBSTRING($value, $position, $length)"; diff --git a/lib/Doctrine/Expression/Oracle.php b/lib/Doctrine/Expression/Oracle.php index 30401fa4d..96fa5e682 100644 --- a/lib/Doctrine/Expression/Oracle.php +++ b/lib/Doctrine/Expression/Oracle.php @@ -52,7 +52,7 @@ class Doctrine_Expression_Oracle extends Doctrine_Expression { * @param integer $length the substring portion length * @return string SQL substring function with given parameters */ - public function substring($value, $position = 1, $length = null) { + public function substring($value, $position, $length = null) { if($length !== null) return "SUBSTR($value, $position, $length)"; diff --git a/lib/Doctrine/Expression/Pgsql.php b/lib/Doctrine/Expression/Pgsql.php index 9879345a4..65132b674 100644 --- a/lib/Doctrine/Expression/Pgsql.php +++ b/lib/Doctrine/Expression/Pgsql.php @@ -1,3 +1,4 @@ +getIdentifier($value); if ($len === null) { diff --git a/lib/Doctrine/Expression/Sqlite.php b/lib/Doctrine/Expression/Sqlite.php index 341cf7a7e..286720296 100644 --- a/lib/Doctrine/Expression/Sqlite.php +++ b/lib/Doctrine/Expression/Sqlite.php @@ -98,7 +98,7 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression { * @param integer $length the substring portion length * @return string SQL substring function with given parameters */ - public function substring($value, $position = 1, $length = null) { + public function substring($value, $position, $length = null) { if($length !== null) return 'SUBSTR(' . $value . ', ' . $position . ', ' . $length . ')'; diff --git a/lib/Doctrine/Import/Builder/BaseClass.php b/lib/Doctrine/Import/Builder/BaseClass.php index 70eff9e54..5ce754477 100644 --- a/lib/Doctrine/Import/Builder/BaseClass.php +++ b/lib/Doctrine/Import/Builder/BaseClass.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ - +Doctrine::autoload('Doctrine_Import_Builder'); /** * @package Doctrine * @url http://www.phpdoctrine.com diff --git a/lib/Doctrine/Import/Reader/Db.php b/lib/Doctrine/Import/Reader/Db.php index 7a7db9ccd..74aaa2586 100644 --- a/lib/Doctrine/Import/Reader/Db.php +++ b/lib/Doctrine/Import/Reader/Db.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ - +Doctrine::autoload('Doctrine_Import_Reader'); /** * @package Doctrine * @url http://www.phpdoctrine.com diff --git a/lib/Doctrine/Import/Reader/Propel.php b/lib/Doctrine/Import/Reader/Propel.php index 1ae011587..0d6d790f1 100644 --- a/lib/Doctrine/Import/Reader/Propel.php +++ b/lib/Doctrine/Import/Reader/Propel.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ - +Doctrine::autoload('Doctrine_Import_Reader'); /** * @package Doctrine * @url http://www.phpdoctrine.com @@ -56,7 +56,7 @@ class Doctrine_Import_Reader_Xml_Propel extends Doctrine_Import_Reader } // end of member function setXml - + public function read() { } diff --git a/lib/Doctrine/Relation/Association.php b/lib/Doctrine/Relation/Association.php index a351bd89e..48d77e7cd 100644 --- a/lib/Doctrine/Relation/Association.php +++ b/lib/Doctrine/Relation/Association.php @@ -18,6 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ +Doctrine::autoload('Doctrine_Relation'); /** * Doctrine_Relation_Association this class takes care of association mapping * (= many-to-many relationships, where the relationship is handled with an additional relational table diff --git a/lib/Doctrine/Relation/Association/Self.php b/lib/Doctrine/Relation/Association/Self.php index 5177b0bc7..b2bd94726 100644 --- a/lib/Doctrine/Relation/Association/Self.php +++ b/lib/Doctrine/Relation/Association/Self.php @@ -1,4 +1,4 @@ -. */ - +Doctrine::autoload('Doctrine_Relation_Association'); +/** + * Doctrine_Relation_Association_Self + * + * @package Doctrine ORM + * @url www.phpdoctrine.com + * @license LGPL + */ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association { /** * getRelationDql @@ -28,26 +35,26 @@ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association { */ public function getRelationDql($count, $context = 'record') { switch($context): - case "record": - $sub = "SELECT ".$this->foreign. - " FROM ".$this->associationTable->getTableName(). - " WHERE ".$this->local. - " = ?"; - $sub2 = "SELECT ".$this->local. - " FROM ".$this->associationTable->getTableName(). - " WHERE ".$this->foreign. - " = ?"; + case 'record': + $sub = 'SELECT '.$this->foreign. + ' FROM '.$this->associationTable->getTableName(). + ' WHERE '.$this->local. + ' = ?'; + $sub2 = 'SELECT '.$this->local. + ' FROM '.$this->associationTable->getTableName(). + ' WHERE '.$this->foreign. + ' = ?'; - $dql = "FROM ".$this->table->getComponentName(); - $dql .= ".".$this->associationTable->getComponentName(); - $dql .= " WHERE ".$this->table->getComponentName().".".$this->table->getIdentifier()." IN ($sub)"; - $dql .= " || ".$this->table->getComponentName().".".$this->table->getIdentifier()." IN ($sub2)"; + $dql = 'FROM '.$this->table->getComponentName(); + $dql .= '.'.$this->associationTable->getComponentName(); + $dql .= ' WHERE '.$this->table->getComponentName().'.'.$this->table->getIdentifier().' IN ('.$sub.')'; + $dql .= ' || '.$this->table->getComponentName().'.'.$this->table->getIdentifier().' IN ('.$sub2.')'; break; - case "collection": - $sub = substr(str_repeat("?, ", $count),0,-2); - $dql = "FROM ".$this->associationTable->getComponentName().".".$this->table->getComponentName(); - $dql .= " WHERE ".$this->associationTable->getComponentName().".".$this->local." IN ($sub)"; + case 'collection': + $sub = substr(str_repeat('?, ', $count),0,-2); + $dql = 'FROM '.$this->associationTable->getComponentName().'.'.$this->table->getComponentName(); + $dql .= ' WHERE '.$this->associationTable->getComponentName().'.'.$this->local.' IN ('.$sub.')'; endswitch; return $dql; @@ -63,15 +70,15 @@ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association { $tableName = $record->getTable()->getTableName(); $identifier = $record->getTable()->getIdentifier(); - $sub = "SELECT ".$this->getForeign(). - " FROM ".$assocTable. - " WHERE ".$this->getLocal(). - " = ?"; + $sub = 'SELECT '.$this->getForeign(). + ' FROM '.$assocTable. + ' WHERE '.$this->getLocal(). + ' = ?'; - $sub2 = "SELECT ".$this->getLocal(). - " FROM ".$assocTable. - " WHERE ".$this->getForeign(). - " = ?"; + $sub2 = 'SELECT '.$this->getLocal(). + ' FROM '.$assocTable. + ' WHERE '.$this->getForeign(). + ' = ?'; $q->select('{'.$tableName.'.*}, {'.$assocTable.'.*}') ->from($tableName.' INNER JOIN '.$assocTable.' ON '. diff --git a/lib/Doctrine/Schema/Column.php b/lib/Doctrine/Schema/Column.php index 6ba8c7e1f..ada5bb12c 100644 --- a/lib/Doctrine/Schema/Column.php +++ b/lib/Doctrine/Schema/Column.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ - +Doctrine::autoload('Doctrine_Schema_Object'); /** * @package Doctrine * @url http://www.phpdoctrine.com diff --git a/lib/Doctrine/Schema/Database.php b/lib/Doctrine/Schema/Database.php index c75fb3ba9..c9148dd26 100644 --- a/lib/Doctrine/Schema/Database.php +++ b/lib/Doctrine/Schema/Database.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ - +Doctrine::autoload('Doctrine_Schema_Object'); /** * @package Doctrine * @url http://www.phpdoctrine.com @@ -45,7 +45,7 @@ class Doctrine_Schema_Database extends Doctrine_Schema_Object { /** * - * @return + * @return * @access public */ public function __clone( ) { diff --git a/lib/Doctrine/Schema/Relation.php b/lib/Doctrine/Schema/Relation.php index 041e29681..4c4bce93f 100644 --- a/lib/Doctrine/Schema/Relation.php +++ b/lib/Doctrine/Schema/Relation.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ - +Doctrine::autoload('Doctrine_Schema_Object'); /** * @package Doctrine * @url http://www.phpdoctrine.com diff --git a/lib/Doctrine/Schema/Table.php b/lib/Doctrine/Schema/Table.php index d18b4ade8..985bec51b 100644 --- a/lib/Doctrine/Schema/Table.php +++ b/lib/Doctrine/Schema/Table.php @@ -18,7 +18,7 @@ * and is licensed under the LGPL. For more information, see * . */ - +Doctrine::autoload('Doctrine_Schema_Object'); /** * @package Doctrine * @url http://www.phpdoctrine.com