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>
11 * @package WoltLabSuite\Core\Data
14 * @mixin AbstractDatabaseObjectAction
16 trait TDatabaseObjectToggle
19 * Validates the "toggle" action.
21 public function validateToggle()
23 $this->validateUpdate();
27 * Toggles the "isDisabled" status of the relevant objects.
29 public function toggle()
31 foreach ($this->getObjects() as $object) {
33 'isDisabled' => $object->isDisabled ?
0 : 1,