FEATURE #2354 @2h30m: add pipeline for edit and create new content

This commit is contained in:
Michal Kváček
2017-03-10 09:52:12 +01:00
parent 55f9c0a679
commit 9bec808d38
32 changed files with 381 additions and 319 deletions
@@ -0,0 +1,35 @@
<?php
namespace Modules\ContactForm\Pipeline\SavePipeline;
use App\CMS\Contracts\Content\SavePipeline\Process;
use App\Models\Content\Content;
class SaveContactInformation implements Process
{
/**
* Process and modify given page
*
* @param Content $page
* @param array $input
*
* @return void>
*/
function handle(Content & $page, array & $input)
{
$settings = [
'phone' => $input['phone'],
'email' => $input['email'],
'contactEmail' => $input['contactEmail'],
'subject' => $input['subject'],
'companyName' => $input['companyName'],
'address' => $input['address'],
'gpsLat' => $input['gpsLat'],
'gpsLng' => $input['gpsLng'],
];
// save settings
$page->moduleSettings = $settings;
$page->save();
}
}