6 * Default implementation of the `IToggleAction` interface.
9 * @copyright 2001-2019 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @mixin AbstractDatabaseObjectAction
15 trait TDatabaseObjectToggle
18 * Validates the "toggle" action.
20 public function validateToggle()
22 $this->validateUpdate();
26 * Toggles the "isDisabled" status of the relevant objects.
28 public function toggle()
30 foreach ($this->getObjects() as $object) {
32 'isDisabled' => $object->isDisabled ?
0 : 1,