protected function _getShares($ids)
{
$shares = array();
- $objects = &$this->_datatree->getObjects($ids, 'DataTreeObject_Share');
+ $objects = $this->_datatree->getObjects($ids, 'DataTreeObject_Share');
if (is_a($objects, 'PEAR_Error')) {
throw new Horde_Share_Exception($objects->getMessage());
}
* @return array All shares for the current app/share.
* @throws Horde_Share_Exception
*/
- function _listAllShares()
+ protected function _listAllShares()
{
$sharelist = $this->_datatree->get(DATATREE_FORMAT_FLAT, DATATREE_ROOT, true);
if ($sharelist instanceof PEAR_Error) {
* @return array The shares the user has access to.
* @throws Horde_Share_Exception
*/
- function _listShares($userid, $perm = Horde_Perms::SHOW,
- $attributes = null, $from = 0, $count = 0,
- $sort_by = null, $direction = 0)
+ protected function _listShares($userid, $perm = Horde_Perms::SHOW,
+ $attributes = null, $from = 0, $count = 0,
+ $sort_by = null, $direction = 0)
{
$key = serialize(array($userid, $perm, $attributes));
if (empty($this->_listCache[$key])) {
}
$datatreeObject = new Horde_Share_Object_DataTree_Share($name);
$datatreeObject->setDataTree($this->_datatree);
- $share = $this->_createObject($datatreeObject);
-
- return $share;
+ return $this->_createObject($datatreeObject);
}
/**
return $criteria;
}
-
}
*
* @return boolean
*/
- public function set($attribute, $value)
- {
- return $this->_set($attribute, $value);
- }
+ abstract public function set($attribute, $value);
/**
* Returns an attribute value from this object.
*
* @return mixed The value for $attribute.
*/
- public function get($attribute)
- {
- return $this->_get($attribute);
- }
+ abstract public function get($attribute);
/**
* Returns the ID of this share.
*
* @return string The share's ID.
*/
- public function getId()
- {
- return $this->_getId();
- }
+ abstract public function getId();
/**
* Returns the name of this share.
*
* @return string The share's name.
*/
- public function getName()
- {
- return $this->_getName();
- }
+ abstract public function getName();
/**
* Saves the current attribute values.
}
/**
+ * Saves the current attribute values.
+ */
+ abstract protected function _save();
+
+ /**
* Gives a user a certain privilege for this share.
*
* @param string $userid The userid of the user.
*
* @return boolean Whether or not $userid has $permission.
*/
- abstract public function hasPermission($userid, $permission, $creator = null);
+ abstract public function hasPermission($userid, $permission,
+ $creator = null);
/**
* Sets the permission of this share.
* permissions on this share.
*/
abstract public function getPermission();
-
}
* @return mixed True if setting the attribute did succeed, a PEAR_Error
* otherwise.
*/
- public function _set($attribute, $value)
+ public function set($attribute, $value)
{
return $this->datatreeObject->set($attribute, $value);
}
*
* @return mixed The value of the attribute, or an empty string.
*/
- public function _get($attribute)
+ public function get($attribute)
{
return $this->datatreeObject->get($attribute);
}
*
* @return string The share's ID.
*/
- protected function _getId()
+ public function getId()
{
return $this->datatreeObject->getId();
}
*
* @return string The share's name.
*/
- protected function _getName()
+ public function getName()
{
return $this->datatreeObject->getName();
}
<?php
-
/**
* Extension of the DataTreeObject class for storing Share information in the
* DataTree driver. If you want to store specialized Share information, you
}
}
}
-
}
* @param string $folder Name of the Kolab folder.
* @param array $perms The permissions of the folder if they are known.
*/
- public function setFolder(&$folder)
+ public function setFolder($folder)
{
if (!isset($this->_folder)) {
- $this->_folder = &$folder;
+ $this->_folder = $folder;
$this->_folder_name = $folder->name;
} else {
throw new Horde_Share_Exception(Horde_Share_Translation::t("The share has already been initialized!"));
*
* @return string The share's ID.
*/
- protected function _getId()
+ public function getId()
{
return $this->_folder->getShareId();
}
*
* @return string The share's name.
*/
- protected function _getName()
+ public function getName()
{
return $this->_folder->getShareId();
}
*
* @return mixed The value for $attribute.
*/
- protected function _get($attribute)
+ public function get($attribute)
{
if (isset($this->_data[$attribute])) {
return $this->_data[$attribute];
* @return mixed True if setting the attribute did succeed, a PEAR_Error
* otherwise.
*/
- protected function _set($attribute, $value)
+ public function set($attribute, $value)
{
switch ($attribute) {
case 'name':
*
* @return boolean
*/
- public function _set($attribute, $value)
+ public function set($attribute, $value)
{
if ($attribute == 'owner') {
return $this->data['share_owner'] = $value;
*
* @return mixed The value of the attribute, or an empty string.
*/
- protected function _get($attribute)
+ public function get($attribute)
{
if ($attribute == 'owner') {
return $this->data['share_owner'];
*
* @return string The share's ID.
*/
- protected function _getId()
+ public function getId()
{
return isset($this->data['share_id']) ? $this->data['share_id'] : null;
}
*
* @return string The share's name.
*/
- protected function _getName()
+ public function getName()
{
return $this->data['share_name'];
}
*
* @return mixed The value of the attribute, or an empty string.
*/
- protected function _get($attribute)
+ public function get($attribute)
{
if ($attribute == 'owner' || $attribute == 'parents') {
return $this->data['share_' . $attribute];
*
* @return unknown
*/
- protected function _getName()
+ public function getName()
{
return '';
}
-
}