Horde_Kolab_Storage_Cache_Data::getAttachment PHP Method

getAttachment() public method

Retrieves an attachment.
public getAttachment ( string $obid, string $attachment_id ) : resource
$obid string Object backend id.
$attachment_id string Attachment ID.
return resource A stream opened to the attachment data.
    public function getAttachment($obid, $attachment_id)
    {
        return $this->_cache->loadAttachment($this->getDataId(), $obid, $attachment_id);
    }

Usage Example

Example #1
0
 /**
  * Returns the specified attachment.
  *
  * @param string $object_id      The object id. @since Kolab_Storage 2.1.0
  * @param string $attachment_id  The attachment id.
  *
  * @return resource An open stream to the attachment data.
  */
 public function getAttachment($object_id, $attachment_id)
 {
     $this->_init();
     return $this->_data_cache->getAttachment($object_id, $attachment_id) ?: parent::getAttachment($object_id, $attachment_id);
 }