You are here

static function CMISRepositoryWrapper::extractObjectFromNode in CMIS API 6.3

Same name and namespace in other branches
  1. 6.4 cmis_common/lib/cmis_repository_wrapper.php \CMISRepositoryWrapper::extractObjectFromNode()
  2. 7 cmis_common/lib/cmis_repository_wrapper.php \CMISRepositoryWrapper::extractObjectFromNode()
2 calls to CMISRepositoryWrapper::extractObjectFromNode()
CMISRepositoryWrapper::extractObject in cmis_common/lib/cmis_repository_wrapper.php
CMISRepositoryWrapper::extractObjectFeedFromNode in cmis_common/lib/cmis_repository_wrapper.php

File

cmis_common/lib/cmis_repository_wrapper.php, line 203

Class

CMISRepositoryWrapper

Code

static function extractObjectFromNode($xmlnode) {

  // Extracts the contents of an Object and organizes them into:
  //  -- Links
  //  -- Properties
  //  -- the Object ID
  // RRM -- NEED TO ADD ALLOWABLEACTIONS
  $retval = new stdClass();
  $retval->links = CMISRepositoryWrapper::getLinksArray($xmlnode);
  $retval->properties = array();
  $prop_nodes = $xmlnode
    ->getElementsByTagName("object")
    ->item(0)
    ->getElementsByTagName("properties")
    ->item(0)->childNodes;
  foreach ($prop_nodes as $pn) {
    if ($pn->attributes) {
      $retval->properties[$pn->attributes
        ->getNamedItem("propertyDefinitionId")->nodeValue] = $pn
        ->getElementsByTagName("value")
        ->item(0)->nodeValue;
    }
  }
  $retval->uuid = $xmlnode
    ->getElementsByTagName("id")
    ->item(0)->nodeValue;
  $retval->id = $retval->properties["cmis:objectId"];
  return $retval;
}