protected function addOwners(array $owners)
    {
        foreach ($owners as $owner) {
            if (isset($this->modelPopulators[$owner])) {
                continue;
            }

            $modelPopulator = new ModelPopulator($this, new $owner, $this->generator, [], []);

            // We'll add the owners in reverse order, so that the children will be associated to their parents.
            $this->addOwners($modelPopulator->getOwners());

            $this->modelPopulators[$owner] = $modelPopulator;
            $this->quantities[$owner] = 1;
        }
    }
protected function addOwners(array $owners)
    {
        foreach ($owners as $owner) {
            if (isset($this->modelPopulators[$owner])) {
                continue;
            }

            $modelPopulator = new ModelPopulator($this, new $owner, $this->generator, [], []);

            // We'll add the owners in reverse order, so that the children will be associated to their parents.
            $this->addOwners($modelPopulator->getOwners());

            $this->modelPopulators[$owner] = $modelPopulator;
            $this->quantities[$owner] = 1;
        }
    }
protected function addOwners ( array $ owners ) { foreach ( $ owners as $ owner ) { if ( isset ( $ this -> modelPopulators [ $ owner ] ) ) { continue ; } $ modelPopulator = new ModelPopulator ( $ this , new $ owner , $ this -> generator , [ ] , [ ] ) ; // We'll add the owners in reverse order, so that the children will be associated to their parents. $ this -> addOwners ( $ modelPopulator -> getOwners ( ) ) ; $ this -> modelPopulators [ $ owner ] = $ modelPopulator ; $ this -> quantities [ $ owner ] = 1 ; } }
Recursively add the owners of a model that haven't already been added.

@param  string[] $owners The class names of the owners.
@return void
Recursively add the owners of a model that haven t already been added .