public static function fromStdClass($stdClass) { $configuration = Configuration::fromStdClass($stdClass->configuration); $shares = array(); if (isset($stdClass->shares) && $stdClass->shares != null) { foreach ($stdClass->shares as $share) { array_push($shares, Share::fromStdClass($share)); } } $quickLink = new AnalyzedQuickLink($stdClass->assetIds, $configuration, $stdClass->description, $shares, $stdClass->title); $quickLink->id = isset($stdClass->id) ? $stdClass->id : null; $quickLink->title = isset($stdClass->title) ? $stdClass->title : null; $quickLink->description = isset($stdClass->description) ? $stdClass->description : null; $quickLink->ownerId = isset($stdClass->ownerId) ? $stdClass->ownerId : null; $quickLink->modified = isset($stdClass->modified) ? $stdClass->modified : null; $quickLink->created = isset($stdClass->created) ? $stdClass->created : null; return $quickLink; }
/** * Create * @param Share $share */ public function createShare(Share $share) { $result = json_decode($this->webClient->post(MediaSiloResourcePaths::SHARE, $share->toJson())); $share->id = $result->id; }