getContent() public method

Fetch the raw content representing the object data.
public getContent ( ) : resource
return resource The raw object content.
Exemplo n.º 1
0
 /**
  * @expectedException Horde_Kolab_Storage_Object_Exception
  */
 public function testFetchingContentsFailsWithMissingMimeId()
 {
     $data = $this->getMock('Horde_Kolab_Storage_Object_Writer');
     $headers = $this->getMock('Horde_Mime_Headers');
     $object = new Horde_Kolab_Storage_Object();
     $this->folder->expects($this->once())->method('getType')->will($this->returnValue('event'));
     $this->folder->expects($this->once())->method('getPath')->will($this->returnValue('INBOX/Calendar'));
     $object->setDriver($this->driver);
     $this->driver->expects($this->once())->method('fetchHeaders')->with('INBOX/Calendar', '1')->will($this->returnValue($headers));
     $object->load('1', $this->folder, $data, new Horde_Mime_Part());
     $object->getContent();
 }
Exemplo n.º 2
0
 /**
  * Return the object data in a form that it can be stored in the backend.
  *
  * @param Horde_Kolab_Storage_Object $object The object that should receive the parsed data.
  *
  * @return resource The encoded object data, ready to be written into the
  *                  backend.
  */
 public function save(Horde_Kolab_Storage_Object $object)
 {
     return $object->getContent();
 }