Commit 9d87bb45 authored by lsmith's avatar lsmith

- remove trailing whitespace

parent 3214810e
......@@ -321,17 +321,17 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
if ( ! $this->expandable) {
return false;
}
if ( ! isset($this->reference)) {
return false;
}
$id = $this->reference->obtainIdentifier();
if (empty($id)) {
return false;
}
switch (get_class($this)) {
case "Doctrine_Collection_Immediate":
$fields = implode(", ",$this->table->getColumnNames());
......
......@@ -159,7 +159,7 @@ class Doctrine_Collection_Batch extends Doctrine_Collection
// Doctrine_Record didn't exist in cache
$this->table->setData($this->data[$key]);
$this->data[$key] = $this->table->getProxy();
$this->data[$key]->addCollection($this);
break;
};
......
......@@ -69,7 +69,7 @@ abstract class Doctrine_Configurable
throw new Doctrine_Exception("Batch size should be greater than or equal to zero");
}
break;
case Doctrine::ATTR_FETCHMODE:
if ($value < 0) {
throw new Doctrine_Exception("Unknown fetchmode. See Doctrine::FETCH_* constants.");
......@@ -98,11 +98,11 @@ abstract class Doctrine_Configurable
break;
case Doctrine::ATTR_ACCESSORS:
$accessors = array('none','get','set','both');
// if ( ! in_array($value,$accessors)) {
// throw new Doctrine_Exception();
// }
break;
case Doctrine::ATTR_COLL_LIMIT:
if ($value < 1) {
......@@ -126,7 +126,7 @@ abstract class Doctrine_Configurable
case Doctrine::ATTR_DEFAULT_TABLE_TYPE:
case Doctrine::ATTR_ACCESSOR_PREFIX_GET:
case Doctrine::ATTR_ACCESSOR_PREFIX_SET:
break;
case Doctrine::ATTR_SEQCOL_NAME:
if ( ! is_string($value)) {
......
......@@ -65,9 +65,9 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
case 'text':
$length = !empty($field['length'])
? $field['length'] : 16777215; // TODO: $db->options['default_text_field_length'];
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? 'CHAR('.$length.')' : 'VARCHAR('.$length.')';
case 'clob':
return 'BLOB SUB_TYPE 1';
......
......@@ -65,10 +65,10 @@ class Doctrine_DataDict_Informix extends Doctrine_DataDict
if (empty($field['length']) && array_key_exists('default', $field)) {
$field['length'] = $this->conn->varchar_max_length;
}
$length = (! empty($field['length'])) ? $field['length'] : false;
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR(255)')
: ($length ? 'VARCHAR('.$length.')' : 'NVARCHAR');
case 'clob':
......
......@@ -67,9 +67,9 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
case 'string':
$length = !empty($field['length'])
? $field['length'] : false;
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$db->options['default_text_field_length'].')')
: ($length ? 'VARCHAR('.$length.')' : 'TEXT');
case 'clob':
......
......@@ -136,13 +136,13 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
switch ($field['type']) {
case 'char':
$length = (! empty($field['length'])) ? $field['length'] : false;
return $length ? 'CHAR('.$length.')' : 'CHAR(255)';
case 'varchar':
case 'array':
case 'object':
case 'string':
if ( ! isset($field['length'])) {
if (array_key_exists('default', $field)) {
$field['length'] = $this->conn->varchar_max_length;
......@@ -150,10 +150,10 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
$field['length'] = false;
}
}
$length = ($field['length'] < $this->conn->varchar_max_length) ? $field['length'] : false;
$fixed = (isset($field['fixed'])) ? $field['fixed'] : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR(255)')
: ($length ? 'VARCHAR(' . $length . ')' : 'TEXT');
case 'clob':
......
......@@ -62,9 +62,9 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
case 'varchar':
$length = !empty($field['length'])
? $field['length'] : 16777215; // TODO: $db->options['default_text_field_length'];
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? 'CHAR('.$length.')' : 'VARCHAR2('.$length.')';
case 'clob':
return 'CLOB';
......
......@@ -366,12 +366,12 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
case 'varchar':
$length = (isset($field['length']) && $field['length']) ? $field['length'] : null;
// TODO: $db->options['default_text_field_length'];
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$db->options['default_text_field_length'].')')
: ($length ? 'VARCHAR('.$length.')' : 'TEXT');
case 'clob':
return 'TEXT';
case 'blob':
......
......@@ -65,9 +65,9 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
case 'gzip':
case 'varchar':
$length = (isset($field['length']) && $field['length']) ? $field['length'] : null;
$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).')')
: ($length ? 'VARCHAR('.$length.')' : 'TEXT');
case 'clob':
......
......@@ -252,7 +252,7 @@ class Doctrine_Db implements Countable, IteratorAggregate, Doctrine_Adapter_Inte
$parts['database'] = ':memory:';
$parts['dsn'] = 'sqlite::memory:';
}
break;
case 'mysql':
case 'informix':
......
This diff is collapsed.
......@@ -68,7 +68,7 @@ class Doctrine_Query_Where extends Doctrine_Query_Condition
case 'regexp':
case 'like':
$operator = $this->getOperator($func);
if (empty($relation)) {
throw new Doctrine_Query_Exception('DQL functions contains/regexp/like can only be used for fields of related components');
}
......
......@@ -105,7 +105,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate
$p = $low;
$p .= "by";
$parts[$low."by"] = array();
} else {
$parts[$p][] = $part;
}
......
......@@ -378,7 +378,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
if ($tmp[$name] !== self::$null) {
if (is_string($tmp[$name])) {
$value = unserialize($tmp[$name]);
if ($value === false)
throw new Doctrine_Record_Exception("Unserialization of $name failed.");
} else {
......@@ -390,10 +390,10 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
case "gzip":
if ($tmp[$name] !== self::$null) {
$value = gzuncompress($tmp[$name]);
if ($value === false)
throw new Doctrine_Record_Exception("Uncompressing of $name failed.");
$this->_data[$name] = $value;
}
break;
......@@ -422,27 +422,27 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
case Doctrine_Identifier::AUTO_INCREMENT:
case Doctrine_Identifier::SEQUENCE:
$name = $this->_table->getIdentifier();
if ($exists) {
if (isset($this->_data[$name]) && $this->_data[$name] !== self::$null) {
$this->_id[$name] = $this->_data[$name];
}
}
unset($this->_data[$name]);
break;
case Doctrine_Identifier::NORMAL:
$this->_id = array();
$name = $this->_table->getIdentifier();
if (isset($this->_data[$name]) && $this->_data[$name] !== self::$null) {
$this->_id[$name] = $this->_data[$name];
}
break;
case Doctrine_Identifier::COMPOSITE:
$names = $this->_table->getIdentifier();
foreach ($names as $name) {
if ($this->_data[$name] === self::$null) {
$this->_id[$name] = null;
......@@ -1021,7 +1021,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
default:
if ($this->_data[$v] instanceof Doctrine_Record)
$this->_data[$v] = $this->_data[$v]->getIncremented();
$a[$v] = $this->_data[$v];
}
}
......
......@@ -113,7 +113,7 @@ class Doctrine_Relation_Association extends Doctrine_Relation
' WHERE ' . $this->local.
' IN (' . substr(str_repeat("?, ", $count),0,-2) .
')';
$dql = "FROM ".$this->table->getComponentName();
$dql .= ".".$this->associationTable->getComponentName();
$dql .= " WHERE ".$this->table->getComponentName().".".$this->table->getIdentifier()." IN ($sub)";
......
......@@ -50,7 +50,7 @@ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association
' 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.')';
......
......@@ -196,7 +196,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
)
)
), $this->columns);
$this->primaryKeys[] = 'id';
$this->identifier = 'id';
$this->identifierType = Doctrine_Identifier::AUTO_INCREMENT;
......@@ -206,19 +206,19 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
if (count($this->primaryKeys) > 1) {
$this->identifier = $this->primaryKeys;
$this->identifierType = Doctrine_Identifier::COMPOSITE;
} else {
foreach ($this->primaryKeys as $pk) {
$e = $this->columns[$pk][2];
$found = false;
foreach ($e as $option => $value) {
if ($found)
break;
$e2 = explode(":",$option);
switch (strtolower($e2[0])) {
case "autoincrement":
$this->identifierType = Doctrine_Identifier::AUTO_INCREMENT;
......
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