Sleimanx2\Plastic\Mappings\Creator::create PHP Method

create() public method

Create a mapping file.
public create ( $model, $path ) : string
$model
$path
return string
    public function create($model, $path)
    {
        $path = $this->getPath($model, $path);
        $stub = $this->getStub();
        $this->files->put($path, $this->populateStub($model, $stub));
        $this->firePostCreateHooks();
        return $path;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Create the mapping file.
  *
  * @param $model
  */
 private function writeMapping($model)
 {
     $path = $this->getMappingPath();
     $file = pathinfo($this->creator->create($model, $path), PATHINFO_FILENAME);
     $this->comment($file . ' was created successfully');
 }