Give MappedMorphTo a more generic property name

This commit is contained in:
Toby Zerner 2015-03-28 12:18:50 +10:30
parent f90a2b9271
commit 89eca757e6

View File

@ -10,7 +10,7 @@ class MappedMorphTo extends MorphTo {
* *
* @var string * @var string
*/ */
protected $types; protected $map;
/** /**
* Create a new morph to relationship instance. * Create a new morph to relationship instance.
@ -23,9 +23,9 @@ class MappedMorphTo extends MorphTo {
* @param string $relation * @param string $relation
* @return void * @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); parent::__construct($query, $parent, $foreignKey, $otherKey, $type, $relation);
} }
@ -38,6 +38,6 @@ class MappedMorphTo extends MorphTo {
*/ */
public function createModelByType($type) public function createModelByType($type)
{ {
return new $this->types[$type]; return new $this->map[$type];
} }
} }