public function getJson($jsonFile, $jsonSchema = null)
    {
        if (isset($jsonSchema) && array_key_exists($jsonSchema, $this->validation)) {
            $validation = $this->validation[$jsonSchema];
        } elseif ($jsonSchema === null) {
            $validation = $jsonSchema;
        } else {
            throw new Exception('Invalid jsonSchema validation key');
        }

        try {
            return $this->decodeFile($jsonFile, $validation);
        } catch (\RuntimeException $e) {
            // Runtime errors such as file not found
            $this->errors[] = $e->getMessage();
        } catch (ValidationFailedException $e) {
            // Schema validation errors
            $this->errors[] = $e->getMessage();
        } catch (\Exception $e) {
            // Anything else we did not anticipate
            $this->errors[] = 'Unknown Exception in getPageDefinition()';
            $this->errors[] = $e->getMessage();
        }

        return null;
    }
public function getJson($jsonFile, $jsonSchema = null)
    {
        if (isset($jsonSchema) && array_key_exists($jsonSchema, $this->validation)) {
            $validation = $this->validation[$jsonSchema];
        } elseif ($jsonSchema === null) {
            $validation = $jsonSchema;
        } else {
            throw new Exception('Invalid jsonSchema validation key');
        }

        try {
            return $this->decodeFile($jsonFile, $validation);
        } catch (\RuntimeException $e) {
            // Runtime errors such as file not found
            $this->errors[] = $e->getMessage();
        } catch (ValidationFailedException $e) {
            // Schema validation errors
            $this->errors[] = $e->getMessage();
        } catch (\Exception $e) {
            // Anything else we did not anticipate
            $this->errors[] = 'Unknown Exception in getPageDefinition()';
            $this->errors[] = $e->getMessage();
        }

        return null;
    }
public function getJson ( $ jsonFile , $ jsonSchema = null ) { if ( isset ( $ jsonSchema ) && array_key_exists ( $ jsonSchema , $ this -> validation ) ) { $ validation = $ this -> validation [ $ jsonSchema ] ; } elseif ( $ jsonSchema === null ) { $ validation = $ jsonSchema ; } else { throw new Exception ( 'Invalid jsonSchema validation key' ) ; } try { return $ this -> decodeFile ( $ jsonFile , $ validation ) ; } catch ( \ RuntimeException $ e ) { // Runtime errors such as file not found $ this -> errors [ ] = $ e -> getMessage ( ) ; } catch ( ValidationFailedException $ e ) { // Schema validation errors $ this -> errors [ ] = $ e -> getMessage ( ) ; } catch ( \ Exception $ e ) { // Anything else we did not anticipate $ this -> errors [ ] = 'Unknown Exception in getPageDefinition()' ; $ this -> errors [ ] = $ e -> getMessage ( ) ; } return null ; }
Get JSON Definition

Validation errors are written to $this->errors
@param string $jsonFile   Path to page JSON file to decode
@param string $jsonSchema Name of validation: settings|page
@return mixed             Object | null
Get JSON Definition