Beispiel #1
0
 /**
  * Builds a query object from a share object.
  *
  * @param Horde_Share_Object $share  A share object representing a query.
  *
  * @return Whups_Query  The query object built from the share.
  */
 protected function _getQuery(Horde_Share_Object $share)
 {
     $queryDetails = $GLOBALS['whups_driver']->getQuery($share->getId());
     $queryDetails['query_id'] = $share->getId();
     $queryDetails['query_name'] = $share->get('name');
     $queryDetails['query_slug'] = $share->get('slug');
     return new Whups_Query($this, $queryDetails);
 }
Beispiel #2
0
 /**
  * Helper for accessing the gallery id
  *
  * @param string $property The property
  *
  * @return mixed
  */
 public function __get($property)
 {
     switch ($property) {
         case 'id':
             return $this->_share->getId();
         default:
             return null;
     }
 }
Beispiel #3
0
 /**
  * Removes a share from the shares system permanently.
  *
  * @param Horde_Share_Object $share  The share to remove.
  */
 protected function _removeShare(Horde_Share_Object $share)
 {
     try {
         $this->getList()->getListManipulation()->deleteFolder($this->_idDecode($share->getId()));
     } catch (Horde_Kolab_Storage_Exception $e) {
         throw new Horde_Share_Exception($e);
     }
 }
Beispiel #4
0
 /**
  * Renames a share in the shares system.
  *
  * @param Horde_Share_Object $share  The share to rename.
  * @param string $name               The share's new name.
  *
  * @throws Horde_Share_Exception
  */
 protected function _renameShare(Horde_Share_Object $share, $name)
 {
     try {
         $this->_db->update('UPDATE ' . $this->_table . ' SET share_name = ? WHERE share_id = ?', array($name, $share->getId()));
     } catch (Horde_Db_Exception $e) {
         throw new Horde_Share_Exception($e);
     }
 }
Beispiel #5
0
 /**
  * Const'r
  *
  * @param array $params
  *
  * @return Kronolith_Resource_Base
  */
 public function __construct(array $params = array())
 {
     $this->_share = $params['share'];
     $this->_id = $this->_share->getId();
 }
Beispiel #6
0
 /**
  * Removes a share from the shares system permanently.
  *
  * @param Horde_Share_Object $share  The share to remove.
  *
  * @throws Horde_Share_Exception
  */
 public function removeShare(Horde_Share_Object $share)
 {
     // Run the results through the callback, if configured.
     $this->runCallback('remove', array($share));
     /* Remove share from the caches. */
     $id = $share->getId();
     unset($this->_shareMap[$id]);
     unset($this->_cache[$share->getName()]);
     /* Reset caches that depend on unknown criteria. */
     $this->expireListCache();
     $this->_removeShare($share);
 }