Exemplo n.º 1
0
 public function setValue($value)
 {
     if (GagawaUtil::gagawaIsEmpty($value)) {
         throw new Exception("Attribute values cannot be " . "empty!");
     }
     $this->value_ = $value;
 }
Exemplo n.º 2
0
 /**
  * Removes the first instance of child from this
  * FertileNode.  Once the first instance of the child
  * is removed, this function will return.  It returns
  * true if a child was removed and false if no child
  * was removed.
  */
 public function removeChild($childNode = NULL)
 {
     if (GagawaUtil::gagawaIsEmpty($childNode)) {
         throw new Exception("You cannot remove an empty " . "child node!");
     }
     for ($i = 0; $i < count($this->children_); $i++) {
         $child = $this->children_[$i];
         if ($child === $childNode) {
             unset($this->children_[$i]);
             return true;
         }
     }
     return false;
 }
Exemplo n.º 3
0
 /**
  * Removes an attribute from this Node, by name.  The name
  * of the attribute to remove cannot be NULL; if so, this
  * function will throw an Exception.
  */
 public function removeAttribute($name = NULL)
 {
     if (GagawaUtil::gagawaIsEmpty($name)) {
         throw new Exception("Attribute name cannot " . "be empty!");
     }
     for ($i = 0; $i < count($this->attributes_); $i++) {
         $attribute = $this->attributes_[$i];
         if ($attribute->getName() === $name) {
             unset($this->attributes_[$i]);
             return true;
         }
     }
     // Couldn't find the attribute, so
     // it wasn't removed.
     return false;
 }
Exemplo n.º 4
0
 public function __construct($xmlns = NULL)
 {
     parent::__construct("html");
     if (!GagawaUtil::gagawaIsEmpty($xmlns)) {
         $this->setXmlns($xmlns);
     }
 }