Example #1
0
 public static function fromJson($json)
 {
     $mixed = json_decode($json);
     return Channel::fromStdClass($mixed);
 }
 /**
  * Updates a Portal
  * @param String $id UUID of portal to update
  * @param string $title Title for the Quicklink
  * @param string $description - Description for the Quicklink
  * @param array $channels - Array channels or std objects containing portal channel data
  * @param array $settings - Key/Value associative array of settings
  * @param string $configId - optional, id of portal settings preset
  * @param string $expires - optional, timestamp in milliseconds
  */
 public function updatePortal($id, $title, $description = "", array $channels = array(), array $settings = array(), $configId = null, $expires = null)
 {
     $portalChannels = array();
     foreach ($channels as $channel) {
         if ($channel instanceof PortalChannel) {
             array_push($portalChannels, $channel);
         } else {
             array_push($portalChannels, PortalChannel::fromStdClass($channel));
         }
     }
     $newSettings = array();
     foreach ($settings as $key => $value) {
         array_push($newSettings, new PortalSetting((string) $key, (string) $value));
     }
     $configuration = new Configuration($configId, $newSettings);
     $portal = new Portal($title, $portalChannels, $configuration, $description, $expires);
     $portal->setId($id);
     $this->portalProxy->updatePortal($portal);
 }