Horde_Share_Base::addShare PHP Method

addShare() public method

The share must first be created with newShare(), and have any initial details added to it, before this function is called.
public addShare ( Horde_Share_Object $share )
$share Horde_Share_Object The new share object.
    public function addShare(Horde_Share_Object $share)
    {
        // Run the results through the callback, if configured.
        $this->runCallback('add', array($share));
        $this->_addShare($share);
        /* Store new share in the caches. */
        $id = $share->getId();
        $name = $share->getName();
        $this->_cache[$name] = $share;
        $this->_shareMap[$id] = $name;
        /* Reset caches that depend on unknown criteria. */
        $this->expireListCache();
    }

Usage Example

コード例 #1
0
ファイル: Base.php プロジェクト: DSNS-LAB/Dmail
 /**
  * Create the default calendar share for the current user.
  *
  * @return Horde_Share_Object The new default share.
  */
 public function createDefaultShare()
 {
     $share = $this->_shares->newShare($this->_user, strval(new Horde_Support_Randomid()), $this->_getDefaultShareName());
     $share->set('color', Kronolith::randomColor());
     $this->_prepareDefaultShare($share);
     $this->_shares->addShare($share);
     return $share;
 }
All Usage Examples Of Horde_Share_Base::addShare