mirror of
https://github.com/flarum/framework.git
synced 2025-04-01 13:25:13 +08:00
Give MappedMorphTo a more generic property name
This commit is contained in:
parent
f90a2b9271
commit
89eca757e6
@ -10,7 +10,7 @@ class MappedMorphTo extends MorphTo {
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $types;
|
||||
protected $map;
|
||||
|
||||
/**
|
||||
* Create a new morph to relationship instance.
|
||||
@ -23,9 +23,9 @@ class MappedMorphTo extends MorphTo {
|
||||
* @param string $relation
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $type, $relation, $types)
|
||||
public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $type, $relation, $map)
|
||||
{
|
||||
$this->types = $types;
|
||||
$this->map = $map;
|
||||
|
||||
parent::__construct($query, $parent, $foreignKey, $otherKey, $type, $relation);
|
||||
}
|
||||
@ -38,6 +38,6 @@ class MappedMorphTo extends MorphTo {
|
||||
*/
|
||||
public function createModelByType($type)
|
||||
{
|
||||
return new $this->types[$type];
|
||||
return new $this->map[$type];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user