Merge branch '3.0'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / data / TDatabaseObjectOptions.class.php
CommitLineData
625136ac
MS
1<?php
2namespace wcf\data;
3
4/**
5 * Provides a method for validating database object options.
6 *
7 * @author Matthias Schmidt
c839bd49 8 * @copyright 2001-2018 WoltLab GmbH
625136ac 9 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
e71525e4
MW
10 * @package WoltLabSuite\Core\Data
11 * @since 3.0
625136ac
MS
12 */
13trait TDatabaseObjectOptions {
14 /**
15 * Returns true if at least one of the options required by this object is set.
16 *
17 * @return boolean
18 */
19 public function validateOptions() {
20 if ($this->options) {
21 $options = explode(',', strtoupper($this->options));
22 foreach ($options as $option) {
23 if (defined($option) && constant($option)) {
24 return true;
25 }
26 }
27
28 return false;
29 }
30
31 return true;
32 }
33}