Esempio n. 1
0
 public function __construct(FeatureObjectBuilder $builder)
 {
     parent::__construct($builder->getObjectID());
     $this->namespace = $builder->getFeatureNamespace();
     $this->name = $builder->getName();
     $this->version = $builder->getVersion();
     $this->compatibilityVersion = $builder->getCompatibilityVersion();
     $this->apiPath = $builder->getApiPath();
 }
 public static function buildFromJSON($json)
 {
     $jsonObject = json_decode($json);
     $signature = SignatureObject::createFromJSON(json_encode($jsonObject->signature));
     $featureArray = array();
     foreach ($jsonObject->featureList as $feature) {
         $featureArray[] = FeatureObjectBuilder::buildFromJSON(json_encode($feature));
     }
     $builder = (new FeatureListObjectBuilder())->objectID($jsonObject->objectID)->featureList($featureArray)->datetime($jsonObject->datetime)->expires($jsonObject->expires)->signature($signature);
     return $builder->build();
 }