Add hasManyThrough relationship

This commit is contained in:
Tommi Finnilä
2016-05-25 09:28:34 +01:00
parent 35ebf3a2ba
commit 4f227d5c57
+2 -1
View File
@@ -353,6 +353,7 @@ class ModelsCommand extends Command
foreach (array( foreach (array(
'hasMany', 'hasMany',
'hasManyThrough',
'belongsToMany', 'belongsToMany',
'hasOne', 'hasOne',
'belongsTo', 'belongsTo',
@@ -370,7 +371,7 @@ class ModelsCommand extends Command
if ($relationObj instanceof Relation) { if ($relationObj instanceof Relation) {
$relatedModel = '\\' . get_class($relationObj->getRelated()); $relatedModel = '\\' . get_class($relationObj->getRelated());
if (in_array($relation, ['belongsToMany', 'hasMany', 'morphMany', 'morphToMany'])) { if (in_array($relation, ['hasManyThrough', 'belongsToMany', 'hasMany', 'morphMany', 'morphToMany'])) {
//Collection or array of models (because Collection is Arrayable) //Collection or array of models (because Collection is Arrayable)
$this->setProperty( $this->setProperty(
$method, $method,