public function __construct() { parent::__construct(); if (!$this->hasItems()) { return false; } if (($items = $this->getItems()) === false) { static::raiseError(__CLASS__ . '::getItems() returned false!'); return false; } if (!isset($items) || empty($items) || !is_array($items)) { static::raiseError(__CLASS__ . '::getItems() returned invalid data!'); return false; } foreach ($items as $item) { if (!$item->hasKey()) { continue; } if (($key = $item->getKey()) === false) { static::raiseError(get_class($item) . '::getKey() returned false!'); return false; } $this->settings[$key] = $item; } return; }