Exemplo n.º 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 = 1, $minorVersion = null)
 {
     $element = parent::getDOM($doc, $majorVersion, $minorVersion);
     if ($this->_pos !== null) {
         $element->appendChild($this->_pos->getDOM($element->ownerDocument));
     }
     return $element;
 }
Exemplo n.º 2
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 sending to the server upon updates, or
  * for application storage/persistence.
  *
  * @param DOMDocument $doc The DOMDocument used to construct DOMElements
  * @param int $majorVersion By default 1
  * @param int $minorVersion (Optional)
  * @return \DOMElement The DOMElement representing this element and all
  */
 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
 {
     $element = parent::getDOM($doc, $majorVersion, $minorVersion);
     if ($this->_value != null) {
         $element->setAttribute('value', $this->_value);
     }
     return $element;
 }
Exemplo n.º 3
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'value':
             $this->_value = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 4
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'scheme':
             $this->_scheme = $attribute->nodeValue;
             break;
         case 'country':
             $this->_country = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 5
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'relationship':
             $this->_relationship = $attribute->nodeValue;
             break;
         case 'type':
             $this->_type = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 6
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'name':
             $name = explode(':', $attribute->nodeValue);
             $this->_name = end($name);
             break;
         case 'value':
             $this->_value = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 7
0
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('gd') . ':' . 'when':
             $when = new When();
             $when->transferFromDOM($child);
             $this->_when = $when;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Exemplo n.º 8
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'url':
             $this->_url = $attribute->nodeValue;
             break;
         case 'height':
             $this->_height = $attribute->nodeValue;
             break;
         case 'width':
             $this->_width = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 9
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'value':
             if ($attribute->nodeValue == "true") {
                 $this->_value = true;
             } elseif ($attribute->nodeValue == "false") {
                 $this->_value = false;
             } else {
                 throw new \ZendGData\App\InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
             }
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 10
0
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'startTime':
             $this->_startTime = $attribute->nodeValue;
             break;
         case 'endTime':
             $this->_endTime = $attribute->nodeValue;
             break;
         case 'valueString':
             $this->_valueString = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 11
0
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'absoluteTime':
             $this->_absoluteTime = $attribute->nodeValue;
             break;
         case 'method':
             $this->_method = $attribute->nodeValue;
             break;
         case 'days':
             $this->_days = $attribute->nodeValue;
             break;
         case 'hours':
             $this->_hours = $attribute->nodeValue;
             break;
         case 'minutes':
             $this->_minutes = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 12
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'min':
             $this->_min = $attribute->nodeValue;
             break;
         case 'max':
             $this->_max = $attribute->nodeValue;
             break;
         case 'numRaters':
             $this->_numRaters = $attribute->nodeValue;
             break;
         case 'average':
             $this->_average = $attribute->nodeValue;
             break;
         case 'value':
             $this->_value = $attribute->nodeValue;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 13
0
 public function __toString()
 {
     if ($this->_valueString != null) {
         return $this->_valueString;
     } else {
         return parent::__toString();
     }
 }
Exemplo n.º 14
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'url':
             $this->_url = $attribute->nodeValue;
             break;
         case 'fileSize':
             $this->_fileSize = $attribute->nodeValue;
             break;
         case 'type':
             $this->_type = $attribute->nodeValue;
             break;
         case 'medium':
             $this->_medium = $attribute->nodeValue;
             break;
         case 'isDefault':
             $this->_isDefault = $attribute->nodeValue;
             break;
         case 'expression':
             $this->_expression = $attribute->nodeValue;
             break;
         case 'bitrate':
             $this->_bitrate = $attribute->nodeValue;
             break;
         case 'framerate':
             $this->_framerate = $attribute->nodeValue;
             break;
         case 'samplingrate':
             $this->_samplingrate = $attribute->nodeValue;
             break;
         case 'channels':
             $this->_channels = $attribute->nodeValue;
             break;
         case 'duration':
             $this->_duration = $attribute->nodeValue;
             break;
         case 'height':
             $this->_height = $attribute->nodeValue;
             break;
         case 'width':
             $this->_width = $attribute->nodeValue;
             break;
         case 'lang':
             $this->_lang = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 15
0
 public function __construct($text = null)
 {
     parent::__construct();
     $this->_text = $text;
 }
Exemplo n.º 16
0
 /**
  * Transfers each child and attribute into member variables.
  * This is called when XML is received over the wire and the data
  * model needs to be built to represent this XML.
  *
  * @param DOMNode $node The DOMNode that represents this object's data
  */
 public function transferFromDOM($node)
 {
     parent::transferFromDOM($node);
     $this->_rootElement = $node->localName;
 }
Exemplo n.º 17
0
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'row':
             $this->_row = $attribute->nodeValue;
             break;
         case 'col':
             $this->_col = $attribute->nodeValue;
             break;
         case 'inputValue':
             $this->_inputValue = $attribute->nodeValue;
             break;
         case 'numericValue':
             $this->_numericValue = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 18
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and valueare
  * stored in an array.
  * TODO: Convert attributes to proper types
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'videoWatchCount':
             $this->_videoWatchCount = $attribute->nodeValue;
             break;
         case 'viewCount':
             $this->_viewCount = $attribute->nodeValue;
             break;
         case 'subscriberCount':
             $this->_subscriberCount = $attribute->nodeValue;
             break;
         case 'lastWebAccess':
             $this->_lastWebAccess = $attribute->nodeValue;
             break;
         case 'favoriteCount':
             $this->_favoriteCount = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 19
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 = 1, $minorVersion = null)
 {
     $element = parent::getDOM($doc, $majorVersion, $minorVersion);
     if ($this->_distance !== null) {
         $element->appendChild($this->_distance->getDOM($element->ownerDocument));
     }
     if ($this->_exposure !== null) {
         $element->appendChild($this->_exposure->getDOM($element->ownerDocument));
     }
     if ($this->_flash !== null) {
         $element->appendChild($this->_flash->getDOM($element->ownerDocument));
     }
     if ($this->_focalLength !== null) {
         $element->appendChild($this->_focalLength->getDOM($element->ownerDocument));
     }
     if ($this->_fStop !== null) {
         $element->appendChild($this->_fStop->getDOM($element->ownerDocument));
     }
     if ($this->_imageUniqueId !== null) {
         $element->appendChild($this->_imageUniqueId->getDOM($element->ownerDocument));
     }
     if ($this->_iso !== null) {
         $element->appendChild($this->_iso->getDOM($element->ownerDocument));
     }
     if ($this->_make !== null) {
         $element->appendChild($this->_make->getDOM($element->ownerDocument));
     }
     if ($this->_model !== null) {
         $element->appendChild($this->_model->getDOM($element->ownerDocument));
     }
     if ($this->_time !== null) {
         $element->appendChild($this->_time->getDOM($element->ownerDocument));
     }
     return $element;
 }
Exemplo n.º 20
0
 public function __construct()
 {
     $this->registerAllNamespaces(ZendGData\Analytics::$namespaces);
     parent::__construct();
 }
Exemplo n.º 21
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('gd') . ':' . 'entryLink':
             $entryLink = new EntryLink();
             $entryLink->transferFromDOM($child);
             $this->_entryLink = $entryLink;
             break;
         case $this->lookupNamespace('gd') . ':' . 'originalEvent':
             $originalEvent = new OriginalEvent();
             $originalEvent->transferFromDOM($child);
             $this->_originalEvent = $originalEvent;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Exemplo n.º 22
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  * @throws \ZendGData\App\InvalidArgumentException
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'userName':
             $this->_username = $attribute->nodeValue;
             break;
         case 'password':
             $this->_password = $attribute->nodeValue;
             break;
         case 'hashFunctionName':
             $this->_hashFunctionName = $attribute->nodeValue;
             break;
         case 'admin':
             if ($attribute->nodeValue == "true") {
                 $this->_admin = true;
             } elseif ($attribute->nodeValue == "false") {
                 $this->_admin = false;
             } else {
                 throw new App\InvalidArgumentException("Expected 'true' or 'false' for apps:login#admin.");
             }
             break;
         case 'agreedToTerms':
             if ($attribute->nodeValue == "true") {
                 $this->_agreedToTerms = true;
             } elseif ($attribute->nodeValue == "false") {
                 $this->_agreedToTerms = false;
             } else {
                 throw new App\InvalidArgumentException("Expected 'true' or 'false' for apps:login#agreedToTerms.");
             }
             break;
         case 'suspended':
             if ($attribute->nodeValue == "true") {
                 $this->_suspended = true;
             } elseif ($attribute->nodeValue == "false") {
                 $this->_suspended = false;
             } else {
                 throw new App\InvalidArgumentException("Expected 'true' or 'false' for apps:login#suspended.");
             }
             break;
         case 'changePasswordAtNextLogin':
             if ($attribute->nodeValue == "true") {
                 $this->_changePasswordAtNextLogin = true;
             } elseif ($attribute->nodeValue == "false") {
                 $this->_changePasswordAtNextLogin = false;
             } else {
                 throw new App\InvalidArgumentException("Expected 'true' or 'false' for apps:login#changePasswordAtNextLogin.");
             }
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 23
0
 /**
  * Constructor for ZendGData\DublinCore\Extension\Title which
  * Name given to the resource
  *
  * @param DOMElement $element (optional) DOMElement from which this
  *          object should be constructed.
  */
 public function __construct($value = null)
 {
     $this->registerAllNamespaces(\ZendGData\DublinCore::$namespaces);
     parent::__construct();
     $this->_text = $value;
 }
Exemplo n.º 24
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'familyName':
             $this->_familyName = $attribute->nodeValue;
             break;
         case 'givenName':
             $this->_givenName = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 25
0
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'countHint':
             $this->_countHint = $attribute->nodeValue;
             break;
         case 'href':
             $this->_href = $attribute->nodeValue;
             break;
         case 'readOnly':
             if ($attribute->nodeValue != "true" && $attribute->nodeValue != "false") {
                 throw new \ZendGData\App\InvalidArgumentException("Expected 'true' or 'false' for gCal:selected#value.");
             }
             $this->_readOnly = $attribute->nodeValue;
             break;
         case 'rel':
             $this->_rel = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 26
0
 /**
  * Given a DOMNode representing an attribute, tries to map the data into
  * instance members.  If no mapping is defined, the name and value are
  * stored in an array.
  *
  * @param DOMNode $attribute The DOMNode attribute needed to be handled
  */
 protected function takeAttributeFromDOM($attribute)
 {
     switch ($attribute->localName) {
         case 'type':
             $this->_type = $attribute->nodeValue;
             break;
         case 'lang':
             $this->_lang = $attribute->nodeValue;
             break;
         case 'start':
             $this->_start = $attribute->nodeValue;
             break;
         case 'end':
             $this->_end = $attribute->nodeValue;
             break;
         default:
             parent::takeAttributeFromDOM($attribute);
     }
 }
Exemplo n.º 27
0
 public function __construct($text = null)
 {
     $this->registerAllNamespaces(\ZendGData\YouTube::$namespaces);
     parent::__construct();
     $this->_text = $text;
 }
Exemplo n.º 28
0
 /**
  * Constructs a new MediaKeywords element
  */
 public function __construct()
 {
     $this->registerAllNamespaces(\ZendGData\Media::$namespaces);
     parent::__construct();
 }
Exemplo n.º 29
0
 /**
  * Constructs a new ZendGData\Geo\Extension\GmlPos object.
  *
  * @param string $text (optional) The value to use for this element.
  */
 public function __construct($text = null)
 {
     $this->registerAllNamespaces(\ZendGData\Geo::$namespaces);
     parent::__construct();
     $this->setText($text);
 }
Exemplo n.º 30
0
 /**
  * Creates individual Entry objects of the appropriate type and
  * stores them in the $_entry array 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('media') . ':' . 'content':
             $content = new MediaContent();
             $content->transferFromDOM($child);
             $this->_content[] = $content;
             break;
         case $this->lookupNamespace('media') . ':' . 'category':
             $category = new MediaCategory();
             $category->transferFromDOM($child);
             $this->_category[] = $category;
             break;
         case $this->lookupNamespace('media') . ':' . 'copyright':
             $copyright = new MediaCopyright();
             $copyright->transferFromDOM($child);
             $this->_copyright = $copyright;
             break;
         case $this->lookupNamespace('media') . ':' . 'credit':
             $credit = new MediaCredit();
             $credit->transferFromDOM($child);
             $this->_credit[] = $credit;
             break;
         case $this->lookupNamespace('media') . ':' . 'description':
             $description = new MediaDescription();
             $description->transferFromDOM($child);
             $this->_description = $description;
             break;
         case $this->lookupNamespace('media') . ':' . 'hash':
             $hash = new MediaHash();
             $hash->transferFromDOM($child);
             $this->_hash[] = $hash;
             break;
         case $this->lookupNamespace('media') . ':' . 'keywords':
             $keywords = new MediaKeywords();
             $keywords->transferFromDOM($child);
             $this->_keywords = $keywords;
             break;
         case $this->lookupNamespace('media') . ':' . 'player':
             $player = new MediaPlayer();
             $player->transferFromDOM($child);
             $this->_player[] = $player;
             break;
         case $this->lookupNamespace('media') . ':' . 'rating':
             $rating = new MediaRating();
             $rating->transferFromDOM($child);
             $this->_rating[] = $rating;
             break;
         case $this->lookupNamespace('media') . ':' . 'restriction':
             $restriction = new MediaRestriction();
             $restriction->transferFromDOM($child);
             $this->_restriction[] = $restriction;
             break;
         case $this->lookupNamespace('media') . ':' . 'text':
             $text = new MediaText();
             $text->transferFromDOM($child);
             $this->_mediaText[] = $text;
             break;
         case $this->lookupNamespace('media') . ':' . 'thumbnail':
             $thumbnail = new MediaThumbnail();
             $thumbnail->transferFromDOM($child);
             $this->_thumbnail[] = $thumbnail;
             break;
         case $this->lookupNamespace('media') . ':' . 'title':
             $title = new MediaTitle();
             $title->transferFromDOM($child);
             $this->_title = $title;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }