예제 #1
0
 /**
  * @internal
  * 
  * @param Splunk_Service $service
  * @param string $path
  * @param SimpleXMLElement|NULL $entry
  *                                  (optional) The <entry> for this 
  *                                  entity, as received from the REST API.
  *                                  If omitted, will be loaded on demand.
  * @param Splunk_Namespace|NULL $namespace
  *                                  (optional) The namespace from which to
  *                                  load this entity, or NULL to use the
  *                                  $service object's default namespace.
  *                                  Does not apply if this entity is 
  *                                  already loaded (i.e. if $entry is not 
  *                                  NULL).
  */
 public function __construct($service, $path, $entry = NULL, $namespace = NULL)
 {
     parent::__construct($service, $path);
     $this->entry = $entry;
     if ($this->entry != NULL) {
         if ($namespace !== NULL) {
             throw new InvalidArgumentException('Cannot specify an entry and a namespace simultaneously. ' . 'The namespace will be inferred from the entry.');
         }
         $this->parseContentsFromEntry();
         $this->namespace = $this->getNamespace();
         // extract from 'eai:acl'
     } else {
         $this->namespace = $namespace;
     }
 }
예제 #2
0
 /**
  * @internal
  * 
  * @param Splunk_Service $service
  * @param string $path
  * @param string $entitySubclass    (optional) name of the entity subclass
  *                                  that this collection's children will
  *                                  be instantiated with.
  */
 public function __construct($service, $path, $entitySubclass = 'Splunk_Entity')
 {
     parent::__construct($service, $path);
     $this->entitySubclass = $entitySubclass;
 }