Commit de07b6a3 authored by zYne's avatar zYne

Dependency and strict standard fixes

parent 30a2b0ea
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
abstract class Doctrine_Access implements ArrayAccess { abstract class Doctrine_Access implements ArrayAccess {
/** /**
* setArray * setArray
*
* @param array $array an array of key => value pairs * @param array $array an array of key => value pairs
* @since 1.0
* @return Doctrine_Access * @return Doctrine_Access
*/ */
public function setArray(array $array) { public function setArray(array $array) {
...@@ -42,18 +44,23 @@ abstract class Doctrine_Access implements ArrayAccess { ...@@ -42,18 +44,23 @@ abstract class Doctrine_Access implements ArrayAccess {
return $this; return $this;
} }
/** /**
* __set -- an alias of set() * __set an alias of set()
*
* @see set, offsetSet * @see set, offsetSet
* @param $name * @param $name
* @param $value * @param $value
* @since 1.0
* @return void
*/ */
public function __set($name,$value) { public function __set($name,$value) {
$this->set($name,$value); $this->set($name,$value);
} }
/** /**
* __get -- an alias of get() * __get -- an alias of get()
*
* @see get, offsetGet * @see get, offsetGet
* @param mixed $name * @param mixed $name
* @since 1.0
* @return mixed * @return mixed
*/ */
public function __get($name) { public function __get($name) {
...@@ -63,6 +70,8 @@ abstract class Doctrine_Access implements ArrayAccess { ...@@ -63,6 +70,8 @@ abstract class Doctrine_Access implements ArrayAccess {
* __isset() * __isset()
* *
* @param string $name * @param string $name
* @since 1.0
* @return boolean whether or not this object contains $name
*/ */
public function __isset($name) { public function __isset($name) {
return $this->contains($name); return $this->contains($name);
...@@ -71,19 +80,21 @@ abstract class Doctrine_Access implements ArrayAccess { ...@@ -71,19 +80,21 @@ abstract class Doctrine_Access implements ArrayAccess {
* __unset() * __unset()
* *
* @param string $name * @param string $name
* @since 1.0
* @return void
*/ */
public function __unset($name) { public function __unset($name) {
return $this->remove($name); return $this->remove($name);
} }
/** /**
* @param mixed $offset * @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) { public function offsetExists($offset) {
return $this->contains($offset); return $this->contains($offset);
} }
/** /**
* offsetGet -- an alias of get() * offsetGet an alias of get()
* @see get, __get * @see get, __get
* @param mixed $offset * @param mixed $offset
* @return mixed * @return mixed
......
<?php <?php
Doctrine::autoload('Doctrine_Connection');
/** /**
* standard connection, the parent of pgsql, mysql and sqlite * standard connection, the parent of pgsql, mysql and sqlite
*/ */
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_Overloadable');
/** /**
* Doctrine_Db_Profiler * Doctrine_Db_Profiler
* *
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_EventListener');
/** /**
* Doctrine_EventListener_AccessorInvoker * Doctrine_EventListener_AccessorInvoker
* *
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_Access'); Doctrine::autoload('Doctrine_Access');
Doctrine::autoload('Doctrine_EventListener_Interface');
/** /**
* Doctrine_EventListener_Chain * Doctrine_EventListener_Chain
* this class represents a chain of different listeners, * this class represents a chain of different listeners,
......
...@@ -60,7 +60,7 @@ class Doctrine_Export_Sqlite extends Doctrine_Export { ...@@ -60,7 +60,7 @@ class Doctrine_Export_Sqlite extends Doctrine_Export {
* @throws PDOException * @throws PDOException
* @return void * @return void
*/ */
public function createIndex($table, $name, $definition) { public function createIndex($table, $name, array $definition) {
$table = $this->conn->quoteIdentifier($table, true); $table = $this->conn->quoteIdentifier($table, true);
$name = $this->dbh->getIndexName($name); $name = $this->dbh->getIndexName($name);
$query = "CREATE INDEX $name ON $table"; $query = "CREATE INDEX $name ON $table";
......
...@@ -51,7 +51,7 @@ class Doctrine_Expression_Mssql extends Doctrine_Expression { ...@@ -51,7 +51,7 @@ class Doctrine_Expression_Mssql extends Doctrine_Expression {
* *
* @return string to call a function to get a substring * @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)) if (!is_null($length))
return "SUBSTRING($value, $position, $length)"; return "SUBSTRING($value, $position, $length)";
......
...@@ -52,7 +52,7 @@ class Doctrine_Expression_Oracle extends Doctrine_Expression { ...@@ -52,7 +52,7 @@ class Doctrine_Expression_Oracle extends Doctrine_Expression {
* @param integer $length the substring portion length * @param integer $length the substring portion length
* @return string SQL substring function with given parameters * @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) if($length !== null)
return "SUBSTR($value, $position, $length)"; return "SUBSTR($value, $position, $length)";
......
<?php
/* /*
* $Id$ * $Id$
* *
...@@ -63,7 +64,7 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression { ...@@ -63,7 +64,7 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression {
* @param int $len extract this amount of characters. * @param int $len extract this amount of characters.
* @return string sql that extracts part of a string. * @return string sql that extracts part of a string.
*/ */
public function subString($value, $from, $len = null) { public function substring($value, $from, $len = null) {
$value = $this->getIdentifier($value); $value = $this->getIdentifier($value);
if ($len === null) { if ($len === null) {
......
...@@ -98,7 +98,7 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression { ...@@ -98,7 +98,7 @@ class Doctrine_Expression_Sqlite extends Doctrine_Expression {
* @param integer $length the substring portion length * @param integer $length the substring portion length
* @return string SQL substring function with given parameters * @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) if($length !== null)
return 'SUBSTR(' . $value . ', ' . $position . ', ' . $length . ')'; return 'SUBSTR(' . $value . ', ' . $position . ', ' . $length . ')';
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_Import_Builder');
/** /**
* @package Doctrine * @package Doctrine
* @url http://www.phpdoctrine.com * @url http://www.phpdoctrine.com
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_Import_Reader');
/** /**
* @package Doctrine * @package Doctrine
* @url http://www.phpdoctrine.com * @url http://www.phpdoctrine.com
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_Import_Reader');
/** /**
* @package Doctrine * @package Doctrine
* @url http://www.phpdoctrine.com * @url http://www.phpdoctrine.com
...@@ -56,7 +56,7 @@ class Doctrine_Import_Reader_Xml_Propel extends Doctrine_Import_Reader ...@@ -56,7 +56,7 @@ class Doctrine_Import_Reader_Xml_Propel extends Doctrine_Import_Reader
} // end of member function setXml } // end of member function setXml
public function read() { }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_Relation');
/** /**
* Doctrine_Relation_Association this class takes care of association mapping * Doctrine_Relation_Association this class takes care of association mapping
* (= many-to-many relationships, where the relationship is handled with an additional relational table * (= many-to-many relationships, where the relationship is handled with an additional relational table
......
<?php <?php
/* /*
* $Id$ * $Id$
* *
...@@ -18,7 +18,14 @@ ...@@ -18,7 +18,14 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::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 { class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association {
/** /**
* getRelationDql * getRelationDql
...@@ -28,26 +35,26 @@ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association { ...@@ -28,26 +35,26 @@ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association {
*/ */
public function getRelationDql($count, $context = 'record') { public function getRelationDql($count, $context = 'record') {
switch($context): switch($context):
case "record": case 'record':
$sub = "SELECT ".$this->foreign. $sub = 'SELECT '.$this->foreign.
" FROM ".$this->associationTable->getTableName(). ' FROM '.$this->associationTable->getTableName().
" WHERE ".$this->local. ' WHERE '.$this->local.
" = ?"; ' = ?';
$sub2 = "SELECT ".$this->local. $sub2 = 'SELECT '.$this->local.
" FROM ".$this->associationTable->getTableName(). ' FROM '.$this->associationTable->getTableName().
" WHERE ".$this->foreign. ' WHERE '.$this->foreign.
" = ?"; ' = ?';
$dql = "FROM ".$this->table->getComponentName(); $dql = 'FROM '.$this->table->getComponentName();
$dql .= ".".$this->associationTable->getComponentName(); $dql .= '.'.$this->associationTable->getComponentName();
$dql .= " WHERE ".$this->table->getComponentName().".".$this->table->getIdentifier()." IN ($sub)"; $dql .= ' WHERE '.$this->table->getComponentName().'.'.$this->table->getIdentifier().' IN ('.$sub.')';
$dql .= " || ".$this->table->getComponentName().".".$this->table->getIdentifier()." IN ($sub2)"; $dql .= ' || '.$this->table->getComponentName().'.'.$this->table->getIdentifier().' IN ('.$sub2.')';
break; break;
case "collection": case 'collection':
$sub = substr(str_repeat("?, ", $count),0,-2); $sub = substr(str_repeat('?, ', $count),0,-2);
$dql = "FROM ".$this->associationTable->getComponentName().".".$this->table->getComponentName(); $dql = 'FROM '.$this->associationTable->getComponentName().'.'.$this->table->getComponentName();
$dql .= " WHERE ".$this->associationTable->getComponentName().".".$this->local." IN ($sub)"; $dql .= ' WHERE '.$this->associationTable->getComponentName().'.'.$this->local.' IN ('.$sub.')';
endswitch; endswitch;
return $dql; return $dql;
...@@ -63,15 +70,15 @@ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association { ...@@ -63,15 +70,15 @@ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association {
$tableName = $record->getTable()->getTableName(); $tableName = $record->getTable()->getTableName();
$identifier = $record->getTable()->getIdentifier(); $identifier = $record->getTable()->getIdentifier();
$sub = "SELECT ".$this->getForeign(). $sub = 'SELECT '.$this->getForeign().
" FROM ".$assocTable. ' FROM '.$assocTable.
" WHERE ".$this->getLocal(). ' WHERE '.$this->getLocal().
" = ?"; ' = ?';
$sub2 = "SELECT ".$this->getLocal(). $sub2 = 'SELECT '.$this->getLocal().
" FROM ".$assocTable. ' FROM '.$assocTable.
" WHERE ".$this->getForeign(). ' WHERE '.$this->getForeign().
" = ?"; ' = ?';
$q->select('{'.$tableName.'.*}, {'.$assocTable.'.*}') $q->select('{'.$tableName.'.*}, {'.$assocTable.'.*}')
->from($tableName.' INNER JOIN '.$assocTable.' ON '. ->from($tableName.' INNER JOIN '.$assocTable.' ON '.
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_Schema_Object');
/** /**
* @package Doctrine * @package Doctrine
* @url http://www.phpdoctrine.com * @url http://www.phpdoctrine.com
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_Schema_Object');
/** /**
* @package Doctrine * @package Doctrine
* @url http://www.phpdoctrine.com * @url http://www.phpdoctrine.com
...@@ -45,7 +45,7 @@ class Doctrine_Schema_Database extends Doctrine_Schema_Object { ...@@ -45,7 +45,7 @@ class Doctrine_Schema_Database extends Doctrine_Schema_Object {
/** /**
* *
* @return * @return
* @access public * @access public
*/ */
public function __clone( ) { public function __clone( ) {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_Schema_Object');
/** /**
* @package Doctrine * @package Doctrine
* @url http://www.phpdoctrine.com * @url http://www.phpdoctrine.com
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see * and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>. * <http://www.phpdoctrine.com>.
*/ */
Doctrine::autoload('Doctrine_Schema_Object');
/** /**
* @package Doctrine * @package Doctrine
* @url http://www.phpdoctrine.com * @url http://www.phpdoctrine.com
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment