src/Charcoal/Admin/Script/Object/Table/AlterPrimaryKeyScript.php
public function setTargetModel($model)
    {
        if (is_string($model)) {
            $model = $this->modelFactory()->get($model);
        }

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

        $this->targetModel = $model;

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

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

        $this->targetModel = $model;

        return $this;
    }
public function setTargetModel ( $ model ) { if ( is_string ( $ model ) ) { $ model = $ this -> modelFactory ( ) -> get ( $ model ) ; } if ( ! $ model instanceof ModelInterface ) { throw new InvalidArgumentException ( sprintf ( 'The model must be an instance of "%s"' , ModelInterface :: class ) ) ; } $ this -> targetModel = $ model ; return $ this ; }
Set the model to alter.

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