示例#1
0
 public function testFromDao()
 {
     $dao = new CacheDao();
     $dao->key = 'cacheKey';
     $dao->data = 'data';
     $item = CacheItem::fromDao($dao);
     $this->assertEquals($dao->key, $item->getKey());
     $this->assertEquals($dao->data, $item->get());
 }
示例#2
0
 /**
  * Delete the DAO from the data store
  *
  * @param IDao $dao
  *
  * @return IDao
  *
  * @throws DataStoreException
  */
 public function delete(IDao $dao)
 {
     $dao = $this->_verifyDao($dao);
     $this->_connectedConnection()->deleteItem(CacheItem::fromDao($dao));
     return $dao;
 }