mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Consistently instantiate HasManyList and ManyManyList using create()
This commit is contained in:
parent
13e632d053
commit
34b9952e9d
@ -1433,7 +1433,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
|
|
||||||
$joinField = $this->getRemoteJoinField($componentName, 'has_many');
|
$joinField = $this->getRemoteJoinField($componentName, 'has_many');
|
||||||
|
|
||||||
$result = new HasManyList($componentClass, $joinField);
|
$result = HasManyList::create($componentClass, $joinField);
|
||||||
if($this->model) $result->setDataModel($this->model);
|
if($this->model) $result->setDataModel($this->model);
|
||||||
$result = $result->forForeignID($this->ID);
|
$result = $result->forForeignID($this->ID);
|
||||||
|
|
||||||
@ -1557,7 +1557,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
return $this->unsavedRelations[$componentName];
|
return $this->unsavedRelations[$componentName];
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = Injector::inst()->create('ManyManyList', $componentClass, $table, $componentField, $parentField,
|
$result = ManyManyList::create($componentClass, $table, $componentField, $parentField,
|
||||||
$this->many_many_extraFields($componentName));
|
$this->many_many_extraFields($componentName));
|
||||||
if($this->model) $result->setDataModel($this->model);
|
if($this->model) $result->setDataModel($this->model);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user