1
0
mirror of synced 2024-12-14 07:06:04 +03:00

Dependency and strict standard fixes

This commit is contained in:
zYne 2006-11-11 19:24:55 +00:00
parent 30a2b0ea74
commit de07b6a345
19 changed files with 69 additions and 45 deletions

View File

@ -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

View File

@ -1,4 +1,5 @@
<?php
Doctrine::autoload('Doctrine_Connection');
/**
* standard connection, the parent of pgsql, mysql and sqlite
*/

View File

@ -18,6 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine::autoload('Doctrine_Overloadable');
/**
* Doctrine_Db_Profiler
*

View File

@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine::autoload('Doctrine_EventListener');
/**
* Doctrine_EventListener_AccessorInvoker
*

View File

@ -19,6 +19,8 @@
* <http://www.phpdoctrine.com>.
*/
Doctrine::autoload('Doctrine_Access');
Doctrine::autoload('Doctrine_EventListener_Interface');
/**
* Doctrine_EventListener_Chain
* this class represents a chain of different listeners,

View File

@ -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";

View File

@ -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)";

View File

@ -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)";

View File

@ -1,3 +1,4 @@
<?php
/*
* $Id$
*
@ -63,7 +64,7 @@ class Doctrine_Expression_Pgsql extends Doctrine_Expression {
* @param int $len extract this amount of characters.
* @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);
if ($len === null) {

View File

@ -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 . ')';

View File

@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine::autoload('Doctrine_Import_Builder');
/**
* @package Doctrine
* @url http://www.phpdoctrine.com

View File

@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine::autoload('Doctrine_Import_Reader');
/**
* @package Doctrine
* @url http://www.phpdoctrine.com

View File

@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
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() { }

View File

@ -18,6 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
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

View File

@ -1,4 +1,4 @@
<?php
<?php
/*
* $Id$
*
@ -18,7 +18,14 @@
* and is licensed under the LGPL. For more information, see
* <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 {
/**
* 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 '.

View File

@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine::autoload('Doctrine_Schema_Object');
/**
* @package Doctrine
* @url http://www.phpdoctrine.com

View File

@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
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( ) {

View File

@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine::autoload('Doctrine_Schema_Object');
/**
* @package Doctrine
* @url http://www.phpdoctrine.com

View File

@ -18,7 +18,7 @@
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
Doctrine::autoload('Doctrine_Schema_Object');
/**
* @package Doctrine
* @url http://www.phpdoctrine.com