1 <?php
2
3 /*
4 * This file is part of the Icybee package.
5 *
6 * (c) Olivier Laviale <olivier.laviale@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Icybee\Modules\Contents;
13
14 use ICanBoogie\I18n\FormattedString;
15
16 /**
17 * Excludes a record from the home page.
18 */
19 class HomeExcludeOperation extends HomeIncludeOperation
20 {
21 protected function process()
22 {
23 $record = $this->record;
24 $record->is_home_excluded = true;
25 $record->save();
26
27 $this->response->message = new FormattedString('%title is now excluded from the home page', [ '%title' => $record->title ]);
28
29 return true;
30 }
31 }