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\Users;
13
14 use ICanBoogie\I18n\FormattedString;
15
16 /**
17 * Disables a user account.
18 */
19 class DeactivateOperation extends ActivateOperation
20 {
21 protected function process()
22 {
23 $record = $this->record;
24 $record->is_activated = false;
25 $record->save();
26
27 $this->response->message = new FormattedString('!name account is deactivated.', [ '!name' => $record->name ]);
28
29 return true;
30 }
31 }