コード例 #1
0
ファイル: EventEntryTest.php プロジェクト: niallmccrudden/zf2
 public function testSetters() {
     $entry = new Calendar\EventEntry();
     $who = new \Zend\GData\Extension\Who();
     $who->setValueString("John Doe");
     $who->setEmail("*****@*****.**");
     $entry->setWho($who);
     $whoRetrieved = $entry->getWho();
     $this->assertEquals("*****@*****.**", $whoRetrieved->getEmail());
     $this->assertEquals("John Doe", $whoRetrieved->getValueString());
 }
コード例 #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('gd') . ':' . 'who':
             $who = new \Zend\GData\Extension\Who();
             $who->transferFromDOM($child);
             $this->_who = $who;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
コード例 #3
0
ファイル: EventEntry.php プロジェクト: navassouza/zf2
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('gd') . ':' . 'where':
             $where = new \Zend\GData\Extension\Where();
             $where->transferFromDOM($child);
             $this->_where[] = $where;
             break;
         case $this->lookupNamespace('gd') . ':' . 'when':
             $when = new \Zend\GData\Extension\When();
             $when->transferFromDOM($child);
             $this->_when[] = $when;
             break;
         case $this->lookupNamespace('gd') . ':' . 'who':
             $who = new \Zend\GData\Extension\Who();
             $who->transferFromDOM($child);
             $this->_who[] = $who;
             break;
         case $this->lookupNamespace('gd') . ':' . 'recurrence':
             $recurrence = new \Zend\GData\Extension\Recurrence();
             $recurrence->transferFromDOM($child);
             $this->_recurrence = $recurrence;
             break;
         case $this->lookupNamespace('gd') . ':' . 'eventStatus':
             $eventStatus = new \Zend\GData\Extension\EventStatus();
             $eventStatus->transferFromDOM($child);
             $this->_eventStatus = $eventStatus;
             break;
         case $this->lookupNamespace('gd') . ':' . 'comments':
             $comments = new \Zend\GData\Extension\Comments();
             $comments->transferFromDOM($child);
             $this->_comments = $comments;
             break;
         case $this->lookupNamespace('gd') . ':' . 'transparency':
             $transparency = new \Zend\GData\Extension\Transparency();
             $transparency->transferFromDOM($child);
             $this->_transparency = $transparency;
             break;
         case $this->lookupNamespace('gd') . ':' . 'visibility':
             $visiblity = new \Zend\GData\Extension\Visibility();
             $visiblity->transferFromDOM($child);
             $this->_visibility = $visiblity;
             break;
         case $this->lookupNamespace('gd') . ':' . 'recurrenceException':
             $recurrenceException = new \Zend\GData\Extension\RecurrenceException();
             $recurrenceException->transferFromDOM($child);
             $this->_recurrenceException[] = $recurrenceException;
             break;
         case $this->lookupNamespace('gd') . ':' . 'originalEvent':
             $originalEvent = new \Zend\GData\Extension\OriginalEvent();
             $originalEvent->transferFromDOM($child);
             $this->_originalEvent = $originalEvent;
             break;
         case $this->lookupNamespace('gd') . ':' . 'extendedProperty':
             $extProp = new \Zend\GData\Extension\ExtendedProperty();
             $extProp->transferFromDOM($child);
             $this->_extendedProperty[] = $extProp;
             break;
         case $this->lookupNamespace('gd') . ':' . 'entryLink':
             $entryLink = new \Zend\GData\Extension\EntryLink();
             $entryLink->transferFromDOM($child);
             $this->_entryLink = $entryLink;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }