public function load($schema_shortname, $component_class = 'PatternBuilder\Property\Component\Component')
    {
        $cid = $this->getCid($schema_shortname);
        if ($this->use_cache && $cache = $this->getCache($cid)) {
            return clone $cache;
        } else {
            if (empty($this->schemaFiles)) {
                $this->schemaFiles = $this->getSchemaFiles();
            }

            if (!isset($this->schemaFiles[$schema_shortname])) {
                $message = sprintf('JSON shortname of %s was not found.', $schema_shortname);
                $this->logger->error($message);

                return false;
            }

            // Loading is limited to this branch of the IF to limit disk IO
            if ($json = $this->loadSchema($this->schemaFiles[$schema_shortname])) {
                $schema_path = $this->schemaFiles[$schema_shortname];
                $component = new $component_class($json, $this->configuration, $schema_shortname, $schema_path);
                $this->setCache($cid, $component);

                return $component;
            } else {
                return false;
            }
        }
    }
public function load($schema_shortname, $component_class = 'PatternBuilder\Property\Component\Component')
    {
        $cid = $this->getCid($schema_shortname);
        if ($this->use_cache && $cache = $this->getCache($cid)) {
            return clone $cache;
        } else {
            if (empty($this->schemaFiles)) {
                $this->schemaFiles = $this->getSchemaFiles();
            }

            if (!isset($this->schemaFiles[$schema_shortname])) {
                $message = sprintf('JSON shortname of %s was not found.', $schema_shortname);
                $this->logger->error($message);

                return false;
            }

            // Loading is limited to this branch of the IF to limit disk IO
            if ($json = $this->loadSchema($this->schemaFiles[$schema_shortname])) {
                $schema_path = $this->schemaFiles[$schema_shortname];
                $component = new $component_class($json, $this->configuration, $schema_shortname, $schema_path);
                $this->setCache($cid, $component);

                return $component;
            } else {
                return false;
            }
        }
    }
public function load ( $ schema_shortname , $ component_class = 'PatternBuilder\Property\Component\Component' ) { $ cid = $ this -> getCid ( $ schema_shortname ) ; if ( $ this -> use_cache && $ cache = $ this -> getCache ( $ cid ) ) { return clone $ cache ; } else { if ( empty ( $ this -> schemaFiles ) ) { $ this -> schemaFiles = $ this -> getSchemaFiles ( ) ; } if ( ! isset ( $ this -> schemaFiles [ $ schema_shortname ] ) ) { $ message = sprintf ( 'JSON shortname of %s was not found.' , $ schema_shortname ) ; $ this -> logger -> error ( $ message ) ; return false ; } // Loading is limited to this branch of the IF to limit disk IO if ( $ json = $ this -> loadSchema ( $ this -> schemaFiles [ $ schema_shortname ] ) ) { $ schema_path = $ this -> schemaFiles [ $ schema_shortname ] ; $ component = new $ component_class ( $ json , $ this -> configuration , $ schema_shortname , $ schema_path ) ; $ this -> setCache ( $ cid , $ component ) ; return $ component ; } else { return false ; } } }
Loads a object either from file or from cache.

@param string $schema_shortname Path to the schema JSON file.
@param string $component_class  Type of class to be returned on successful object creation.

@return mixed Either an object or FALSE on error.
Loads a object either from file or from cache .