Removed indexGenerator
This commit is contained in:
parent
b340bfe11d
commit
2e3f800265
@ -1,25 +0,0 @@
|
||||
<?php
|
||||
class Doctrine_IndexGenerator {
|
||||
/**
|
||||
* @var string $name
|
||||
*/
|
||||
private $name;
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function __construct($name) {
|
||||
$this->name = $name;
|
||||
}
|
||||
/**
|
||||
* @param Doctrine_Record $record
|
||||
* @return mixed
|
||||
*/
|
||||
public function getIndex(Doctrine_Record $record) {
|
||||
$value = $record->get($this->name);
|
||||
if($value === null)
|
||||
throw new Doctrine_Exception("Couldn't create collection index. Record field '".$this->name."' was null.");
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
@ -800,26 +800,24 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
||||
foreach($array as $k => $v) {
|
||||
$type = $this->table->getTypeOf($v);
|
||||
|
||||
if($type == 'array' ||
|
||||
$type == 'object') {
|
||||
switch($type) {
|
||||
case 'array':
|
||||
case 'object':
|
||||
$a[$v] = serialize($this->data[$v]);
|
||||
break;;
|
||||
case 'enum'
|
||||
$a[$v] = $this->table->enumIndex($v,$this->data[$v]);
|
||||
break;
|
||||
default:
|
||||
if($this->data[$v] instanceof Doctrine_Record)
|
||||
$this->data[$v] = $this->data[$v]->getIncremented();
|
||||
|
||||
$a[$v] = serialize($this->data[$v]);
|
||||
continue;
|
||||
|
||||
} elseif($type == 'enum') {
|
||||
$a[$v] = $this->table->enumIndex($v,$this->data[$v]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if($this->data[$v] instanceof Doctrine_Record) {
|
||||
$this->data[$v] = $this->data[$v]->getIncremented();
|
||||
}
|
||||
|
||||
if($this->data[$v] === self::$null)
|
||||
$a[$v] = null;
|
||||
else
|
||||
$a[$v] = $this->data[$v];
|
||||
|
||||
if($this->data[$v] === self::$null)
|
||||
$a[$v] = null;
|
||||
else
|
||||
$a[$v] = $this->data[$v];
|
||||
}
|
||||
}
|
||||
|
||||
foreach($this->table->getInheritanceMap() as $k => $v) {
|
||||
|
Loading…
Reference in New Issue
Block a user