public function loadAllRelsFor(Models $models, array $rels, $flags = null)
    {
        $rels = Arr::toAssoc($rels);

        foreach ($rels as $relName => $childRels) {
            $foreign = $this->loadRelFor($models, $relName, $flags);

            if ($childRels) {
                $rel = $this->getRel($relName);
                $rel->getRepo()->loadAllRelsFor($foreign, $childRels, $flags);
            }
        }

        return $this;
    }
public function loadAllRelsFor(Models $models, array $rels, $flags = null)
    {
        $rels = Arr::toAssoc($rels);

        foreach ($rels as $relName => $childRels) {
            $foreign = $this->loadRelFor($models, $relName, $flags);

            if ($childRels) {
                $rel = $this->getRel($relName);
                $rel->getRepo()->loadAllRelsFor($foreign, $childRels, $flags);
            }
        }

        return $this;
    }
public function loadAllRelsFor ( Models $ models , array $ rels , $ flags = null ) { $ rels = Arr :: toAssoc ( $ rels ) ; foreach ( $ rels as $ relName => $ childRels ) { $ foreign = $ this -> loadRelFor ( $ models , $ relName , $ flags ) ; if ( $ childRels ) { $ rel = $ this -> getRel ( $ relName ) ; $ rel -> getRepo ( ) -> loadAllRelsFor ( $ foreign , $ childRels , $ flags ) ; } } return $ this ; }
Load all the models for the provided relations. This is the meat of the eager loading

@param  Models           $models
@param  array            $rels
@param  int              $flags
@return Repo $this
Load all the models for the provided relations . This is the meat of the eager loading