Beispiel #1
0
 /**
  * To update the $resourceBox::Source object by parsing the atom XML in $str.
  * [Note: Do not call this function from your application, it is used internally]
  *
  * @param string $str
  * @param ResourceBox $resourceBox
  * @param string $content_type
  */
 public function LoadResourceBox($str, $resourceBox, $content_type)
 {
     $resource = $resourceBox->GetResource();
     $uri = null;
     $atomEntry = null;
     AtomParser::PopulateObject($str, $resource, $uri, $atomEntry);
     if (isset($uri)) {
         $index = Utility::reverseFind($uri, '/');
         $editLink = substr($uri, $index + 1, strlen($uri) - $index);
         $resourceBox->Identity = $uri;
         $resourceBox->EditLink = $editLink;
     }
     //If $str represents content of entry of type Media then
     //popluate values specific to media entry
     $resourceBox->EditMediaLink = $atomEntry->EditMediaLink;
     $resourceBox->MediaLinkEntry = $atomEntry->MediaLinkEntry;
     $resourceBox->StreamETag = $atomEntry->StreamETag;
     $resourceBox->EntityETag = $atomEntry->EntityETag;
     $resourceBox->StreamLink = $atomEntry->MediaContentUri;
 }