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

- remove trailing whitespace

This commit is contained in:
lsmith 2006-12-29 21:46:14 +00:00
parent 3214810e8f
commit 9d87bb45f4
18 changed files with 1434 additions and 1434 deletions

View File

@ -321,17 +321,17 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
if ( ! $this->expandable) { if ( ! $this->expandable) {
return false; return false;
} }
if ( ! isset($this->reference)) { if ( ! isset($this->reference)) {
return false; return false;
} }
$id = $this->reference->obtainIdentifier(); $id = $this->reference->obtainIdentifier();
if (empty($id)) { if (empty($id)) {
return false; return false;
} }
switch (get_class($this)) { switch (get_class($this)) {
case "Doctrine_Collection_Immediate": case "Doctrine_Collection_Immediate":
$fields = implode(", ",$this->table->getColumnNames()); $fields = implode(", ",$this->table->getColumnNames());

View File

@ -159,7 +159,7 @@ class Doctrine_Collection_Batch extends Doctrine_Collection
// Doctrine_Record didn't exist in cache // Doctrine_Record didn't exist in cache
$this->table->setData($this->data[$key]); $this->table->setData($this->data[$key]);
$this->data[$key] = $this->table->getProxy(); $this->data[$key] = $this->table->getProxy();
$this->data[$key]->addCollection($this); $this->data[$key]->addCollection($this);
break; break;
}; };

View File

@ -69,7 +69,7 @@ abstract class Doctrine_Configurable
throw new Doctrine_Exception("Batch size should be greater than or equal to zero"); throw new Doctrine_Exception("Batch size should be greater than or equal to zero");
} }
break; break;
case Doctrine::ATTR_FETCHMODE: case Doctrine::ATTR_FETCHMODE:
if ($value < 0) { if ($value < 0) {
throw new Doctrine_Exception("Unknown fetchmode. See Doctrine::FETCH_* constants."); throw new Doctrine_Exception("Unknown fetchmode. See Doctrine::FETCH_* constants.");
@ -98,11 +98,11 @@ abstract class Doctrine_Configurable
break; break;
case Doctrine::ATTR_ACCESSORS: case Doctrine::ATTR_ACCESSORS:
$accessors = array('none','get','set','both'); $accessors = array('none','get','set','both');
// if ( ! in_array($value,$accessors)) { // if ( ! in_array($value,$accessors)) {
// throw new Doctrine_Exception(); // throw new Doctrine_Exception();
// } // }
break; break;
case Doctrine::ATTR_COLL_LIMIT: case Doctrine::ATTR_COLL_LIMIT:
if ($value < 1) { if ($value < 1) {
@ -126,7 +126,7 @@ abstract class Doctrine_Configurable
case Doctrine::ATTR_DEFAULT_TABLE_TYPE: case Doctrine::ATTR_DEFAULT_TABLE_TYPE:
case Doctrine::ATTR_ACCESSOR_PREFIX_GET: case Doctrine::ATTR_ACCESSOR_PREFIX_GET:
case Doctrine::ATTR_ACCESSOR_PREFIX_SET: case Doctrine::ATTR_ACCESSOR_PREFIX_SET:
break; break;
case Doctrine::ATTR_SEQCOL_NAME: case Doctrine::ATTR_SEQCOL_NAME:
if ( ! is_string($value)) { if ( ! is_string($value)) {

View File

@ -65,9 +65,9 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
case 'text': case 'text':
$length = !empty($field['length']) $length = !empty($field['length'])
? $field['length'] : 16777215; // TODO: $db->options['default_text_field_length']; ? $field['length'] : 16777215; // TODO: $db->options['default_text_field_length'];
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? 'CHAR('.$length.')' : 'VARCHAR('.$length.')'; return $fixed ? 'CHAR('.$length.')' : 'VARCHAR('.$length.')';
case 'clob': case 'clob':
return 'BLOB SUB_TYPE 1'; return 'BLOB SUB_TYPE 1';

View File

@ -65,10 +65,10 @@ class Doctrine_DataDict_Informix extends Doctrine_DataDict
if (empty($field['length']) && array_key_exists('default', $field)) { if (empty($field['length']) && array_key_exists('default', $field)) {
$field['length'] = $this->conn->varchar_max_length; $field['length'] = $this->conn->varchar_max_length;
} }
$length = (! empty($field['length'])) ? $field['length'] : false; $length = (! empty($field['length'])) ? $field['length'] : false;
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR(255)') return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR(255)')
: ($length ? 'VARCHAR('.$length.')' : 'NVARCHAR'); : ($length ? 'VARCHAR('.$length.')' : 'NVARCHAR');
case 'clob': case 'clob':

View File

@ -67,9 +67,9 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
case 'string': case 'string':
$length = !empty($field['length']) $length = !empty($field['length'])
? $field['length'] : false; ? $field['length'] : false;
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$db->options['default_text_field_length'].')') return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$db->options['default_text_field_length'].')')
: ($length ? 'VARCHAR('.$length.')' : 'TEXT'); : ($length ? 'VARCHAR('.$length.')' : 'TEXT');
case 'clob': case 'clob':

View File

@ -136,13 +136,13 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
switch ($field['type']) { switch ($field['type']) {
case 'char': case 'char':
$length = (! empty($field['length'])) ? $field['length'] : false; $length = (! empty($field['length'])) ? $field['length'] : false;
return $length ? 'CHAR('.$length.')' : 'CHAR(255)'; return $length ? 'CHAR('.$length.')' : 'CHAR(255)';
case 'varchar': case 'varchar':
case 'array': case 'array':
case 'object': case 'object':
case 'string': case 'string':
if ( ! isset($field['length'])) { if ( ! isset($field['length'])) {
if (array_key_exists('default', $field)) { if (array_key_exists('default', $field)) {
$field['length'] = $this->conn->varchar_max_length; $field['length'] = $this->conn->varchar_max_length;
@ -150,10 +150,10 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
$field['length'] = false; $field['length'] = false;
} }
} }
$length = ($field['length'] < $this->conn->varchar_max_length) ? $field['length'] : false; $length = ($field['length'] < $this->conn->varchar_max_length) ? $field['length'] : false;
$fixed = (isset($field['fixed'])) ? $field['fixed'] : false; $fixed = (isset($field['fixed'])) ? $field['fixed'] : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR(255)') return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR(255)')
: ($length ? 'VARCHAR(' . $length . ')' : 'TEXT'); : ($length ? 'VARCHAR(' . $length . ')' : 'TEXT');
case 'clob': case 'clob':

View File

@ -62,9 +62,9 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
case 'varchar': case 'varchar':
$length = !empty($field['length']) $length = !empty($field['length'])
? $field['length'] : 16777215; // TODO: $db->options['default_text_field_length']; ? $field['length'] : 16777215; // TODO: $db->options['default_text_field_length'];
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? 'CHAR('.$length.')' : 'VARCHAR2('.$length.')'; return $fixed ? 'CHAR('.$length.')' : 'VARCHAR2('.$length.')';
case 'clob': case 'clob':
return 'CLOB'; return 'CLOB';

View File

@ -366,12 +366,12 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
case 'varchar': case 'varchar':
$length = (isset($field['length']) && $field['length']) ? $field['length'] : null; $length = (isset($field['length']) && $field['length']) ? $field['length'] : null;
// TODO: $db->options['default_text_field_length']; // TODO: $db->options['default_text_field_length'];
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$db->options['default_text_field_length'].')') return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$db->options['default_text_field_length'].')')
: ($length ? 'VARCHAR('.$length.')' : 'TEXT'); : ($length ? 'VARCHAR('.$length.')' : 'TEXT');
case 'clob': case 'clob':
return 'TEXT'; return 'TEXT';
case 'blob': case 'blob':

View File

@ -65,9 +65,9 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
case 'gzip': case 'gzip':
case 'varchar': case 'varchar':
$length = (isset($field['length']) && $field['length']) ? $field['length'] : null; $length = (isset($field['length']) && $field['length']) ? $field['length'] : null;
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->getAttribute(Doctrine::ATTR_DEFAULT_TEXTFLD_LENGTH).')') return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->getAttribute(Doctrine::ATTR_DEFAULT_TEXTFLD_LENGTH).')')
: ($length ? 'VARCHAR('.$length.')' : 'TEXT'); : ($length ? 'VARCHAR('.$length.')' : 'TEXT');
case 'clob': case 'clob':

View File

@ -252,7 +252,7 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte
$parts['database'] = ':memory:'; $parts['database'] = ':memory:';
$parts['dsn'] = 'sqlite::memory:'; $parts['dsn'] = 'sqlite::memory:';
} }
break; break;
case 'mysql': case 'mysql':
case 'informix': case 'informix':

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,7 @@ class Doctrine_Query_Where extends Doctrine_Query_Condition
case 'regexp': case 'regexp':
case 'like': case 'like':
$operator = $this->getOperator($func); $operator = $this->getOperator($func);
if (empty($relation)) { if (empty($relation)) {
throw new Doctrine_Query_Exception('DQL functions contains/regexp/like can only be used for fields of related components'); throw new Doctrine_Query_Exception('DQL functions contains/regexp/like can only be used for fields of related components');
} }

View File

@ -105,7 +105,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate
$p = $low; $p = $low;
$p .= "by"; $p .= "by";
$parts[$low."by"] = array(); $parts[$low."by"] = array();
} else { } else {
$parts[$p][] = $part; $parts[$p][] = $part;
} }

View File

@ -378,7 +378,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
if ($tmp[$name] !== self::$null) { if ($tmp[$name] !== self::$null) {
if (is_string($tmp[$name])) { if (is_string($tmp[$name])) {
$value = unserialize($tmp[$name]); $value = unserialize($tmp[$name]);
if ($value === false) if ($value === false)
throw new Doctrine_Record_Exception("Unserialization of $name failed."); throw new Doctrine_Record_Exception("Unserialization of $name failed.");
} else { } else {
@ -390,10 +390,10 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
case "gzip": case "gzip":
if ($tmp[$name] !== self::$null) { if ($tmp[$name] !== self::$null) {
$value = gzuncompress($tmp[$name]); $value = gzuncompress($tmp[$name]);
if ($value === false) if ($value === false)
throw new Doctrine_Record_Exception("Uncompressing of $name failed."); throw new Doctrine_Record_Exception("Uncompressing of $name failed.");
$this->_data[$name] = $value; $this->_data[$name] = $value;
} }
break; break;
@ -422,27 +422,27 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
case Doctrine_Identifier::AUTO_INCREMENT: case Doctrine_Identifier::AUTO_INCREMENT:
case Doctrine_Identifier::SEQUENCE: case Doctrine_Identifier::SEQUENCE:
$name = $this->_table->getIdentifier(); $name = $this->_table->getIdentifier();
if ($exists) { if ($exists) {
if (isset($this->_data[$name]) && $this->_data[$name] !== self::$null) { if (isset($this->_data[$name]) && $this->_data[$name] !== self::$null) {
$this->_id[$name] = $this->_data[$name]; $this->_id[$name] = $this->_data[$name];
} }
} }
unset($this->_data[$name]); unset($this->_data[$name]);
break; break;
case Doctrine_Identifier::NORMAL: case Doctrine_Identifier::NORMAL:
$this->_id = array(); $this->_id = array();
$name = $this->_table->getIdentifier(); $name = $this->_table->getIdentifier();
if (isset($this->_data[$name]) && $this->_data[$name] !== self::$null) { if (isset($this->_data[$name]) && $this->_data[$name] !== self::$null) {
$this->_id[$name] = $this->_data[$name]; $this->_id[$name] = $this->_data[$name];
} }
break; break;
case Doctrine_Identifier::COMPOSITE: case Doctrine_Identifier::COMPOSITE:
$names = $this->_table->getIdentifier(); $names = $this->_table->getIdentifier();
foreach ($names as $name) { foreach ($names as $name) {
if ($this->_data[$name] === self::$null) { if ($this->_data[$name] === self::$null) {
$this->_id[$name] = null; $this->_id[$name] = null;
@ -1021,7 +1021,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
default: default:
if ($this->_data[$v] instanceof Doctrine_Record) if ($this->_data[$v] instanceof Doctrine_Record)
$this->_data[$v] = $this->_data[$v]->getIncremented(); $this->_data[$v] = $this->_data[$v]->getIncremented();
$a[$v] = $this->_data[$v]; $a[$v] = $this->_data[$v];
} }
} }

View File

@ -113,7 +113,7 @@ class Doctrine_Relation_Association extends Doctrine_Relation
' WHERE ' . $this->local. ' WHERE ' . $this->local.
' IN (' . substr(str_repeat("?, ", $count),0,-2) . ' IN (' . substr(str_repeat("?, ", $count),0,-2) .
')'; ')';
$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)";

View File

@ -50,7 +50,7 @@ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association
' 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.')';

View File

@ -196,7 +196,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
) )
) )
), $this->columns); ), $this->columns);
$this->primaryKeys[] = 'id'; $this->primaryKeys[] = 'id';
$this->identifier = 'id'; $this->identifier = 'id';
$this->identifierType = Doctrine_Identifier::AUTO_INCREMENT; $this->identifierType = Doctrine_Identifier::AUTO_INCREMENT;
@ -206,19 +206,19 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
if (count($this->primaryKeys) > 1) { if (count($this->primaryKeys) > 1) {
$this->identifier = $this->primaryKeys; $this->identifier = $this->primaryKeys;
$this->identifierType = Doctrine_Identifier::COMPOSITE; $this->identifierType = Doctrine_Identifier::COMPOSITE;
} else { } else {
foreach ($this->primaryKeys as $pk) { foreach ($this->primaryKeys as $pk) {
$e = $this->columns[$pk][2]; $e = $this->columns[$pk][2];
$found = false; $found = false;
foreach ($e as $option => $value) { foreach ($e as $option => $value) {
if ($found) if ($found)
break; break;
$e2 = explode(":",$option); $e2 = explode(":",$option);
switch (strtolower($e2[0])) { switch (strtolower($e2[0])) {
case "autoincrement": case "autoincrement":
$this->identifierType = Doctrine_Identifier::AUTO_INCREMENT; $this->identifierType = Doctrine_Identifier::AUTO_INCREMENT;