Nqxcode\LuceneSearch\Model\Config::newInstanceBy PHP 메소드

newInstanceBy() 개인적인 메소드

Create instance of model by class UID.
private newInstanceBy ( $classUid ) : Model
$classUid
리턴 Illuminate\Database\Eloquent\Model
    private function newInstanceBy($classUid)
    {
        foreach ($this->configuration as $config) {
            if ($config['class_uid'] == $classUid) {
                /** @var Model $repository */
                $repository = $config['repository'];
                return $repository->newInstance();
            }
        }
        throw new \InvalidArgumentException("Can't find class for classUid: '{$classUid}'.");
    }