Ejemplo n.º 1
0
 /**
  * This creates a unique JSON schema validator object
  * And for each type of class generates the according JSON schema
  * By combining this root classs element schema
  * And the child class' schema
  * The schema has then to be called static::$schema and not self::$schema
  *
  * @return void 
  */
 private static function _init()
 {
     if (!self::$validator) {
         self::$validator = new \JsonSchema\Validator();
         if (is_string(self::$schema)) {
             self::$schema = json_decode(self::$schema);
         }
     }
     if (!empty(static::$schema)) {
         static::$schema = \bbn\tools::merge_objects(self::$schema, \bbn\tools::to_object(static::$schema));
     } else {
         static::$schema = self::$schema;
     }
 }