コード例 #1
0
ファイル: QuickAddTest.php プロジェクト: omusico/sugar_work
 public function testNormalQuickAddShouldHaveNoExtensionElements()
 {
     $this->quickAdd->value = false;
     $this->assertEquals($this->quickAdd->value, false);
     $this->assertEquals(count($this->quickAdd->extensionElements), 0);
     $newQuickAdd = new Zend_Gdata_Calendar_Extension_QuickAdd();
     $newQuickAdd->transferFromXML($this->quickAdd->saveXML());
     $this->assertEquals(count($newQuickAdd->extensionElements), 0);
     $newQuickAdd->extensionElements = array(new Zend_Gdata_App_Extension_Element('foo', 'atom', null, 'bar'));
     $this->assertEquals(count($newQuickAdd->extensionElements), 1);
     $this->assertEquals($newQuickAdd->value, false);
     /* try constructing using magic factory */
     $cal = new Zend_Gdata_Calendar();
     $newQuickAdd2 = $cal->newQuickAdd();
     $newQuickAdd2->transferFromXML($newQuickAdd->saveXML());
     $this->assertEquals(count($newQuickAdd2->extensionElements), 1);
     $this->assertEquals($newQuickAdd2->value, false);
 }
コード例 #2
0
ファイル: Calendar.php プロジェクト: jorgenils/zend-framework
/**
 * Creates an event on the authenticated user's default calendar using 
 * the specified QuickAdd string.
 *
 * @param Zend_Http_Client $client The authenticated client object
 * @param string $quickAddText The QuickAdd text for the event
 * @return string The ID URL for the event
 */
function createQuickAddEvent($client, $quickAddText)
{
    $gdataCal = new Zend_Gdata_Calendar($client);
    $event = $gdataCal->newEventEntry();
    $event->content = $gdataCal->newContent($quickAddText);
    $event->quickAdd = $gdataCal->newQuickAdd(true);
    $newEvent = $gdataCal->insertEvent($event);
    return $newEvent->id->text;
}