/** * Will load a serialized map from the storage file, if it exists * * @return bool */ protected function load() { $this->stackableMap = $this->getInitialContext()->getAttribute(self::CLASS_MAP); // Can we read the intended path? if (!isset($this->stackableMap)) { // If the map of our parent is empty we have to start generating it if (empty($this->map)) { // First of all try to use the parent load function, maybe we got it within a file. // If not we have to start generating if (!parent::load()) { // Start generation parent::generate(); } } // Get the map $this->stackableMap = new GenericStackable(); // Copy the contents from the array into our stackable foreach ($this->map as $key => $entry) { $this->stackableMap[$key] = $entry; } // Remove the version entry from the map, we do not need it unset($this->stackableMap['version']); // Save the generated class into our storage $this->getInitialContext()->setAttribute(self::CLASS_MAP, $this->stackableMap); return true; } else { return true; } }