public function byRepo(Closure $yield)
    {
        $repos = Objects::groupBy($this->models, function (AbstractModel $model) {
            return $model->getRepo()->getRootRepo();
        });

        foreach ($repos as $repo) {
            $models = new Models();
            $models->addObjects($repos->getInfo());

            $yield($repo, $models);
        }
    }
public function byRepo(Closure $yield)
    {
        $repos = Objects::groupBy($this->models, function (AbstractModel $model) {
            return $model->getRepo()->getRootRepo();
        });

        foreach ($repos as $repo) {
            $models = new Models();
            $models->addObjects($repos->getInfo());

            $yield($repo, $models);
        }
    }
public function byRepo ( Closure $ yield ) { $ repos = Objects :: groupBy ( $ this -> models , function ( AbstractModel $ model ) { return $ model -> getRepo ( ) -> getRootRepo ( ) ; } ) ; foreach ( $ repos as $ repo ) { $ models = new Models ( ) ; $ models -> addObjects ( $ repos -> getInfo ( ) ) ; $ yield ( $ repo , $ models ) ; } }
Group models by repo, call yield for each repo

@param Closure $yield Call for each repo ($repo, $models)
Group models by repo call yield for each repo