20 lines
485 B
PHP
20 lines
485 B
PHP
<?php
|
|
namespace App\CMS\Pipeline\SavePipeline\Process;
|
|
|
|
use App\CMS\Contracts\Content\SavePipeline\Process;
|
|
use App\Models\Content\Content;
|
|
|
|
class SaveCommonFields implements Process {
|
|
/**
|
|
* Process and modify given page
|
|
*
|
|
* @param Content $page
|
|
* @param array $input
|
|
*
|
|
* @return void
|
|
*/
|
|
function handle(Content & $page, array &$input)
|
|
{
|
|
($page->exists == false) ? $page = Content::create($input): $page->update($input);
|
|
}
|
|
} |