This commit is contained in:
parent
b3cf15a1dd
commit
9ea8d5da70
@ -46,21 +46,13 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
*/
|
*/
|
||||||
protected $reference;
|
protected $reference;
|
||||||
/**
|
/**
|
||||||
* @var string $reference_field the reference field of the collection
|
* @var string $referenceField the reference field of the collection
|
||||||
*/
|
*/
|
||||||
protected $reference_field;
|
protected $referenceField;
|
||||||
/**
|
/**
|
||||||
* @var Doctrine_Relation the record this collection is related to, if any
|
* @var Doctrine_Relation the record this collection is related to, if any
|
||||||
*/
|
*/
|
||||||
protected $relation;
|
protected $relation;
|
||||||
/**
|
|
||||||
* @var boolean $expandable whether or not this collection has been expanded
|
|
||||||
*/
|
|
||||||
protected $expandable = true;
|
|
||||||
/**
|
|
||||||
* @var array $expanded
|
|
||||||
*/
|
|
||||||
protected $expanded = array();
|
|
||||||
/**
|
/**
|
||||||
* @var string $keyColumn the name of the column that is used for collection key mapping
|
* @var string $keyColumn the name of the column that is used for collection key mapping
|
||||||
*/
|
*/
|
||||||
@ -110,27 +102,6 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return $this->table;
|
return $this->table;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* setAggregateValue
|
|
||||||
*
|
|
||||||
* @param string $name
|
|
||||||
* @param string $value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setAggregateValue($name, $value)
|
|
||||||
{
|
|
||||||
$this->aggregateValues[$name] = $value;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* getAggregateValue
|
|
||||||
*
|
|
||||||
* @param string $name
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function getAggregateValue($name)
|
|
||||||
{
|
|
||||||
return $this->aggregateValues[$name];
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* this method is automatically called when this Doctrine_Collection is serialized
|
* this method is automatically called when this Doctrine_Collection is serialized
|
||||||
*
|
*
|
||||||
@ -178,26 +149,6 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
$this->keyColumn = $name;
|
$this->keyColumn = $name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* isExpanded
|
|
||||||
*
|
|
||||||
* whether or not an offset batch has been expanded
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function isExpanded($offset)
|
|
||||||
{
|
|
||||||
return isset($this->expanded[$offset]);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* isExpandable
|
|
||||||
*
|
|
||||||
* whether or not this collection is expandable
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function isExpandable()
|
|
||||||
{
|
|
||||||
return $this->expandable;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* setKeyColumn
|
* setKeyColumn
|
||||||
*
|
*
|
||||||
@ -269,15 +220,15 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|| $relation instanceof Doctrine_Relation_LocalKey
|
|| $relation instanceof Doctrine_Relation_LocalKey
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$this->reference_field = $relation->getForeign();
|
$this->referenceField = $relation->getForeign();
|
||||||
|
|
||||||
$value = $record->get($relation->getLocal());
|
$value = $record->get($relation->getLocal());
|
||||||
|
|
||||||
foreach ($this->getNormalIterator() as $record) {
|
foreach ($this->getNormalIterator() as $record) {
|
||||||
if ($value !== null) {
|
if ($value !== null) {
|
||||||
$record->set($this->reference_field, $value, false);
|
$record->set($this->referenceField, $value, false);
|
||||||
} else {
|
} else {
|
||||||
$record->set($this->reference_field, $this->reference, false);
|
$record->set($this->referenceField, $this->reference, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($relation instanceof Doctrine_Relation_Association) {
|
} elseif ($relation instanceof Doctrine_Relation_Association) {
|
||||||
@ -293,127 +244,6 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
{
|
{
|
||||||
return $this->reference;
|
return $this->reference;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* expand
|
|
||||||
* expands the collection
|
|
||||||
*
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function expand($key)
|
|
||||||
{
|
|
||||||
$where = array();
|
|
||||||
$params = array();
|
|
||||||
$limit = null;
|
|
||||||
$offset = null;
|
|
||||||
|
|
||||||
switch (get_class($this)) {
|
|
||||||
case "Doctrine_Collection_Offset":
|
|
||||||
$limit = $this->getLimit();
|
|
||||||
$offset = (floor($key / $limit) * $limit);
|
|
||||||
|
|
||||||
if ( ! $this->expandable && isset($this->expanded[$offset])) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$fields = implode(", ",$this->table->getColumnNames());
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
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());
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$fields = implode(", ",$this->table->getPrimaryKeys());
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
if (isset($this->relation)) {
|
|
||||||
if ($this->relation instanceof Doctrine_Relation_ForeignKey) {
|
|
||||||
$params[] = $this->reference->getIncremented();
|
|
||||||
$where[] = $this->reference_field." = ?";
|
|
||||||
|
|
||||||
if ( ! isset($offset)) {
|
|
||||||
$ids = $this->getPrimaryKeys();
|
|
||||||
|
|
||||||
if ( ! empty($ids)) {
|
|
||||||
$where[] = $this->table->getIdentifier()." NOT IN (".substr(str_repeat("?, ",count($ids)),0,-2).")";
|
|
||||||
$params = array_merge($params,$ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->expandable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
} elseif ($this->relation instanceof Doctrine_Relation_Association) {
|
|
||||||
|
|
||||||
$asf = $this->relation->getAssociationFactory();
|
|
||||||
$query = 'SELECT '.$foreign." FROM ".$asf->getTableName()." WHERE ".$local."=".$this->getIncremented();
|
|
||||||
|
|
||||||
$table = $fk->getTable();
|
|
||||||
$graph = new Doctrine_Query($table->getConnection());
|
|
||||||
|
|
||||||
$q = 'FROM ' . $table->getComponentName() . ' WHERE ' . $table->getComponentName() . '.' . $table->getIdentifier()." IN ($query)";
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$query = "SELECT ".$fields." FROM ".$this->table->getTableName();
|
|
||||||
|
|
||||||
// apply column aggregation inheritance
|
|
||||||
$map = $this->table->inheritanceMap;
|
|
||||||
foreach ($map as $k => $v) {
|
|
||||||
$where[] = $k." = ?";
|
|
||||||
$params[] = $v;
|
|
||||||
}
|
|
||||||
if ( ! empty($where)) {
|
|
||||||
$query .= " WHERE ".implode(" AND ",$where);
|
|
||||||
}
|
|
||||||
|
|
||||||
$coll = $this->table->execute($query, $params, $limit, $offset);
|
|
||||||
|
|
||||||
if ( ! isset($offset)) {
|
|
||||||
foreach ($coll as $record) {
|
|
||||||
if (isset($this->reference_field)) {
|
|
||||||
$record->set($this->reference_field,$this->reference, false);
|
|
||||||
}
|
|
||||||
$this->reference->addReference($record, $this->relation);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$i = $offset;
|
|
||||||
|
|
||||||
foreach ($coll as $record) {
|
|
||||||
if (isset($this->reference)) {
|
|
||||||
$this->reference->addReference($record, $this->relation, $i);
|
|
||||||
} else {
|
|
||||||
$this->data[$i] = $record;
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->expanded[$offset] = true;
|
|
||||||
|
|
||||||
// check if the fetched collection's record count is smaller
|
|
||||||
// than the query limit, if so this collection has been expanded to its max size
|
|
||||||
|
|
||||||
if (count($coll) < $limit) {
|
|
||||||
$this->expandable = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $coll;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* remove
|
* remove
|
||||||
* removes a specified collection element
|
* removes a specified collection element
|
||||||
@ -467,8 +297,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
if ($key === null) {
|
if ($key === null) {
|
||||||
$record = $this->table->create();
|
$record = $this->table->create();
|
||||||
|
|
||||||
if (isset($this->reference_field)) {
|
if (isset($this->referenceField)) {
|
||||||
$record->set($this->reference_field, $this->reference, false);
|
$record->set($this->referenceField, $this->reference, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data[] = $record;
|
$this->data[] = $record;
|
||||||
@ -478,19 +308,16 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
|
|
||||||
if ( ! isset($this->data[$key])) {
|
if ( ! isset($this->data[$key])) {
|
||||||
$this->expand($key);
|
|
||||||
|
|
||||||
if ( ! isset($this->data[$key])) {
|
if ( ! isset($this->data[$key])) {
|
||||||
$this->data[$key] = $this->table->create();
|
$this->data[$key] = $this->table->create();
|
||||||
}
|
}
|
||||||
if (isset($this->reference_field)) {
|
if (isset($this->referenceField)) {
|
||||||
$value = $this->reference->get($this->relation->getLocal());
|
$value = $this->reference->get($this->relation->getLocal());
|
||||||
|
|
||||||
if ($value !== null) {
|
if ($value !== null) {
|
||||||
$this->data[$key]->set($this->reference_field, $value, false);
|
$this->data[$key]->set($this->referenceField, $value, false);
|
||||||
} else {
|
} else {
|
||||||
|
$this->data[$key]->set($this->referenceField, $this->reference, false);
|
||||||
$this->data[$key]->set($this->reference_field, $this->reference, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -512,7 +339,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
} else {
|
} else {
|
||||||
$list[] = $record->getIncremented();
|
$list[] = $record->getIncremented();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -542,8 +369,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
*/
|
*/
|
||||||
public function set($key, Doctrine_Record $record)
|
public function set($key, Doctrine_Record $record)
|
||||||
{
|
{
|
||||||
if (isset($this->reference_field)) {
|
if (isset($this->referenceField)) {
|
||||||
$record->set($this->reference_field, $this->reference, false);
|
$record->set($this->referenceField, $this->reference, false);
|
||||||
}
|
}
|
||||||
$this->data[$key] = $record;
|
$this->data[$key] = $record;
|
||||||
}
|
}
|
||||||
@ -555,8 +382,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
*/
|
*/
|
||||||
public function add(Doctrine_Record $record,$key = null)
|
public function add(Doctrine_Record $record,$key = null)
|
||||||
{
|
{
|
||||||
if (isset($this->reference_field)) {
|
if (isset($this->referenceField)) {
|
||||||
$record->set($this->reference_field, $this->reference, false);
|
$record->set($this->referenceField, $this->reference, false);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* for some weird reason in_array cannot be used here (php bug ?)
|
* for some weird reason in_array cannot be used here (php bug ?)
|
||||||
@ -720,7 +547,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
|
|||||||
|
|
||||||
foreach ($this as $key => $record) {
|
foreach ($this as $key => $record) {
|
||||||
$record->save($conn);
|
$record->save($conn);
|
||||||
};
|
}
|
||||||
|
|
||||||
$conn->commit();
|
$conn->commit();
|
||||||
}
|
}
|
||||||
|
@ -111,10 +111,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
* @var array $references an array containing all the references
|
* @var array $references an array containing all the references
|
||||||
*/
|
*/
|
||||||
private $references = array();
|
private $references = array();
|
||||||
/**
|
|
||||||
* @var array $originals an array containing all the original references
|
|
||||||
*/
|
|
||||||
private $originals = array();
|
|
||||||
/**
|
/**
|
||||||
* @var integer $index this index is used for creating object identifiers
|
* @var integer $index this index is used for creating object identifiers
|
||||||
*/
|
*/
|
||||||
@ -611,9 +607,10 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($err)
|
if ($err) {
|
||||||
throw new Doctrine_Record_State_Exception('Unknown record state ' . $state);
|
throw new Doctrine_Record_State_Exception('Unknown record state ' . $state);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* refresh
|
* refresh
|
||||||
* refresh internal data from the database
|
* refresh internal data from the database
|
||||||
@ -622,7 +619,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
* this record represents does not exist anymore)
|
* this record represents does not exist anymore)
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
final public function refresh()
|
public function refresh()
|
||||||
{
|
{
|
||||||
$id = $this->obtainIdentifier();
|
$id = $this->obtainIdentifier();
|
||||||
if ( ! is_array($id)) {
|
if ( ! is_array($id)) {
|
||||||
@ -661,7 +658,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
* @throws Doctrine_Record_Exception When the primary key of this record doesn't match the primary key fetched from a collection
|
* @throws Doctrine_Record_Exception When the primary key of this record doesn't match the primary key fetched from a collection
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
final public function factoryRefresh()
|
public function factoryRefresh()
|
||||||
{
|
{
|
||||||
$this->_data = $this->_table->getData();
|
$this->_data = $this->_table->getData();
|
||||||
$old = $this->_id;
|
$old = $this->_id;
|
||||||
@ -670,8 +667,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
|
|
||||||
$this->prepareIdentifiers();
|
$this->prepareIdentifiers();
|
||||||
|
|
||||||
if ($this->_id != $old)
|
if ($this->_id != $old) {
|
||||||
throw new Doctrine_Record_Exception("The refreshed primary key doesn't match the one in the record memory.", Doctrine::ERR_REFRESH);
|
throw new Doctrine_Record_Exception("The refreshed primary key doesn't match the one in the record memory.", Doctrine::ERR_REFRESH);
|
||||||
|
}
|
||||||
|
|
||||||
$this->_state = Doctrine_Record::STATE_CLEAN;
|
$this->_state = Doctrine_Record::STATE_CLEAN;
|
||||||
$this->_modified = array();
|
$this->_modified = array();
|
||||||
@ -684,7 +682,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
*
|
*
|
||||||
* @return object Doctrine_Table a Doctrine_Table object
|
* @return object Doctrine_Table a Doctrine_Table object
|
||||||
*/
|
*/
|
||||||
final public function getTable()
|
public function getTable()
|
||||||
{
|
{
|
||||||
return $this->_table;
|
return $this->_table;
|
||||||
}
|
}
|
||||||
@ -694,7 +692,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
*
|
*
|
||||||
* @return array an array containing all the properties
|
* @return array an array containing all the properties
|
||||||
*/
|
*/
|
||||||
final public function getData()
|
public function getData()
|
||||||
{
|
{
|
||||||
return $this->_data;
|
return $this->_data;
|
||||||
}
|
}
|
||||||
@ -707,7 +705,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
* @throws Doctrine_Record_Exception if trying to get an unknown property
|
* @throws Doctrine_Record_Exception if trying to get an unknown property
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function rawGet($name)
|
public function rawGet($name)
|
||||||
{
|
{
|
||||||
if ( ! isset($this->_data[$name])) {
|
if ( ! isset($this->_data[$name])) {
|
||||||
@ -718,7 +715,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
|
|
||||||
return $this->_data[$name];
|
return $this->_data[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* load
|
* load
|
||||||
* loads all the unitialized properties from the database
|
* loads all the unitialized properties from the database
|
||||||
@ -1164,19 +1160,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
{
|
{
|
||||||
return new Doctrine_Record_Iterator($this);
|
return new Doctrine_Record_Iterator($this);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* getOriginals
|
|
||||||
* returns an original collection of related component
|
|
||||||
*
|
|
||||||
* @return Doctrine_Collection|false
|
|
||||||
*/
|
|
||||||
public function obtainOriginals($name)
|
|
||||||
{
|
|
||||||
if (isset($this->originals[$name])) {
|
|
||||||
return $this->originals[$name];
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* deletes this data access object and all the related composites
|
* deletes this data access object and all the related composites
|
||||||
* this operation is isolated by a transaction
|
* this operation is isolated by a transaction
|
||||||
@ -1255,17 +1238,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
$this->_modified = array();
|
$this->_modified = array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* assignOriginals
|
|
||||||
*
|
|
||||||
* @param string $alias
|
|
||||||
* @param Doctrine_Collection $coll
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function assignOriginals($alias, Doctrine_Collection $coll)
|
|
||||||
{
|
|
||||||
$this->originals[$alias] = $coll;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* returns the primary keys of this object
|
* returns the primary keys of this object
|
||||||
*
|
*
|
||||||
@ -1347,24 +1319,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function lazyInitRelated(Doctrine_Collection $coll, Doctrine_Relation $connector)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* addReference
|
|
||||||
* @param Doctrine_Record $record
|
|
||||||
* @param mixed $key
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function addReference(Doctrine_Record $record, Doctrine_Relation $connector, $key = null)
|
|
||||||
{
|
|
||||||
$alias = $connector->getAlias();
|
|
||||||
|
|
||||||
$this->references[$alias]->add($record, $key);
|
|
||||||
$this->originals[$alias]->add($record, $key);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* getReferences
|
* getReferences
|
||||||
* @return array all references
|
* @return array all references
|
||||||
@ -1373,17 +1327,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
{
|
{
|
||||||
return $this->references;
|
return $this->references;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* setRelated
|
|
||||||
*
|
|
||||||
* @param string $alias
|
|
||||||
* @param Doctrine_Access $coll
|
|
||||||
*/
|
|
||||||
final public function setRelated($alias, Doctrine_Access $coll)
|
|
||||||
{
|
|
||||||
$this->references[$alias] = $coll;
|
|
||||||
$this->originals[$alias] = $coll;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* loadReference
|
* loadReference
|
||||||
* loads a related component
|
* loads a related component
|
||||||
@ -1394,7 +1337,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
*/
|
*/
|
||||||
final public function loadReference($name)
|
final public function loadReference($name)
|
||||||
{
|
{
|
||||||
|
|
||||||
$fk = $this->_table->getRelation($name);
|
$fk = $this->_table->getRelation($name);
|
||||||
|
|
||||||
if ($fk->isOneToOne()) {
|
if ($fk->isOneToOne()) {
|
||||||
@ -1404,7 +1346,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
$coll = $fk->fetchRelatedFor($this);
|
$coll = $fk->fetchRelatedFor($this);
|
||||||
|
|
||||||
$this->references[$name] = $coll;
|
$this->references[$name] = $coll;
|
||||||
$this->originals[$name] = clone $coll;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -1562,17 +1503,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
|||||||
$this->_table->setOption($name, $value);
|
$this->_table->setOption($name, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* index
|
|
||||||
* defines a foreignKey
|
|
||||||
*
|
|
||||||
* @param array $definition the definition array
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function foreignKey(array $definition = array())
|
|
||||||
{
|
|
||||||
return $this->_table->addForeignKey($definition);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* index
|
* index
|
||||||
* defines or retrieves an index
|
* defines or retrieves an index
|
||||||
|
Loading…
x
Reference in New Issue
Block a user