示例#1
0
 /**
  * Retrieves a DOMElement which corresponds to this element and all
  * child properties.  This is used to build an entry back into a DOM
  * and eventually XML text for application storage/persistence.
  *
  * @param DOMDocument $doc The DOMDocument used to construct DOMElements
  * @return DOMElement The DOMElement representing this element and all
  *          child properties.
  */
 public function getDOM($doc = null, $majorVersion = 3, $minorVersion = null)
 {
     $element = parent::getDOM($doc, $majorVersion, $minorVersion);
     if ($this->_role !== null) {
         $element->appendChild($this->_role->getDOM($element->ownerDocument));
     }
     if ($this->_scope !== null) {
         $element->appendChild($this->_scope->getDOM($element->ownerDocument));
     }
     return $element;
 }
示例#2
0
    /**
     * Creates individual Entry objects of the appropriate type and
     * stores them as members of this entry based upon DOM data.
     *
     * @param DOMNode $child The DOMNode to process
     */
    protected function takeChildFromDOM($child)
    {
        $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;

        switch ($absoluteNodeName) {
            case $this->lookupNamespace('gAcl') . ':' . 'role';
                $role = new Extension\ACLRole();
                $role->transferFromDOM($child);
                $this->_role = $role;
                break;
            case $this->lookupNamespace('gAcl') . ':' . 'scope';
                $scope = new Extension\ACLScope();
                $scope->transferFromDOM($child);
                $this->_scope = $scope;
                break;
            default:
                parent::takeChildFromDOM($child);
                break;
        }
    }