public static function buildFromJSON($json) { // TODO parse and verify json $jsonObject = json_decode($json); $signature = SignatureObject::createFromJSON(json_encode($jsonObject->signature)); return (new TagObjectBuilder())->objectID($jsonObject->objectID)->targetID($jsonObject->targetID)->author($jsonObject->author)->tag($jsonObject->tag)->datePublished($jsonObject->datePublished)->signature($signature)->build(); }
public static function buildFromJSON($json) { // TODO parse and verify json $jsonObject = json_decode($json); $signature = SignatureObject::createFromJSON(json_encode($jsonObject->signature)); return (new LinkObjectBuilder())->objectID($jsonObject->objectID)->owner($jsonObject->owner)->link($jsonObject->link)->datetime($jsonObject->datetime)->signature($signature)->build(); }
public static function buildFromJSON($json) { // TODO parse and verify json $jsonObject = json_decode($json); $signature = SignatureObject::createFromJSON(json_encode($jsonObject->signature)); return (new ConversationStatusObjectBuilder())->objectID($jsonObject->objectID)->targetID($jsonObject->targetID)->author($jsonObject->author)->status($jsonObject->status)->datetime($jsonObject->datetime)->targetGID($jsonObject->targetGID)->signature($signature)->build(); }
public static function buildFromJSON($json) { // TODO parse and verify json $jsonObject = json_decode($json); $signature = SignatureObject::createFromJSON(json_encode($jsonObject->signature)); return (new StreamItemObjectBuilder())->objectID($jsonObject->objectID)->owner($jsonObject->owner)->author($jsonObject->author)->dateTime($jsonObject->datetime)->activity(new JSONObject($jsonObject->activity))->signature($signature)->build(); }
public static function buildFromJSON($json) { // TODO parse and verify json $jsonObject = json_decode($json); $signature = SignatureObject::createFromJSON(json_encode($jsonObject->signature)); return (new SearchQueryObjectBuilder())->objectID($jsonObject->objectID)->initiatingGID($jsonObject->initiatingGID)->query(ESQueryBuilder::buildFromJSON(json_encode($jsonObject->query)))->hopCount($jsonObject->hopCount)->datetime($jsonObject->datetime)->signature($signature)->build(); }
public static function buildFromJSON($json) { // TODO parse and verify json $jsonObject = json_decode($json); $signature = SignatureObject::createFromJSON(json_encode($jsonObject->signature)); $builder = (new ConversationMessageObjectBuilder())->objectID($jsonObject->objectID)->targetID($jsonObject->targetID)->author($jsonObject->author)->body($jsonObject->body)->datetime($jsonObject->datetime)->status($jsonObject->status)->signature($signature); if (property_exists($jsonObject, 'title')) { $builder->title($jsonObject->title); } return $builder->build(); }
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(); }
public static function buildFromJSON($json) { // TODO parse and verify json $json = json_decode($json); $signature = SignatureObject::createFromJSON(json_encode($json->signature)); $builder = new CommentObjectBuilder(); $builder->objectID($json->objectID)->targetID($json->targetID)->author($json->author)->comment($json->comment)->datePublished($json->datePublished)->signature($signature); if (property_exists($json, 'dateUpdated')) { $builder->dateUpdated($json->dateUpdated); } return $builder->build(); }
public static function buildFromJSON($json) { // TODO parse and verify json $jsonObject = json_decode($json); $signature = SignatureObject::createFromJSON(json_encode($jsonObject->signature)); $builder = (new ConversationObjectBuilder())->objectID($jsonObject->objectID)->members($jsonObject->members)->datetime($jsonObject->datetime)->owner($jsonObject->owner)->signature($signature); $memberArray = array(); foreach ($jsonObject->members as $member) { $memberArray[] = $member; } if (is_array($memberArray)) { asort($memberArray); } $builder->members($memberArray); if (property_exists($jsonObject, 'title')) { $builder->title($jsonObject->title); } return $builder->build(); }