Horde_Kolab_Storage_Cache_Data::getDataId PHP Method

getDataId() public method

Returns the ID for the data cache.
public getDataId ( ) : string
return string The unique ID for the data used when caching it.
    public function getDataId()
    {
        if ($this->_data_id === null) {
            throw new Horde_Kolab_Storage_Exception('You must set the ID of the data cache!');
        }
        return $this->_data_id;
    }

Usage Example

Example #1
0
 /**
  * @expectedException Horde_Kolab_Storage_Exception
  */
 public function testMissingDataId()
 {
     $cache = new Horde_Kolab_Storage_Cache_Data($this->getMockCache());
     $cache->getDataId();
 }