src/Charcoal/Loader/CollectionLoader.php
public function setModel($model)
    {
        if (is_string($model)) {
            $model = $this->factory()->get($model);
        }

        if (!$model instanceof ModelInterface) {
            throw new InvalidArgumentException(
                sprintf(
                    'The model must be an instance of "%s"',
                    ModelInterface::class
                )
            );
        }

        $this->model = $model;

        $this->setSource($model->source());

        return $this;
    }
public function setModel($model)
    {
        if (is_string($model)) {
            $model = $this->factory()->get($model);
        }

        if (!$model instanceof ModelInterface) {
            throw new InvalidArgumentException(
                sprintf(
                    'The model must be an instance of "%s"',
                    ModelInterface::class
                )
            );
        }

        $this->model = $model;

        $this->setSource($model->source());

        return $this;
    }
public function setModel ( $ model ) { if ( is_string ( $ model ) ) { $ model = $ this -> factory ( ) -> get ( $ model ) ; } if ( ! $ model instanceof ModelInterface ) { throw new InvalidArgumentException ( sprintf ( 'The model must be an instance of "%s"' , ModelInterface :: class ) ) ; } $ this -> model = $ model ; $ this -> setSource ( $ model -> source ( ) ) ; return $ this ; }
Set the model to use for the loaded objects.

@param  string|ModelInterface $model An object model.
@throws InvalidArgumentException If the given argument is not a model.
@return self
Set the model to use for the loaded objects .