Kronolith_Resource_Group::getId PHP Method

getId() public method

Obtain the resource's internal identifier, taking into account whether or not we have validated/selected a resource for this group yet.
public getId ( ) : string
return string The id.
    public function getId()
    {
        if (!empty($this->_selectedResource)) {
            return $this->_selectedResource->getId();
        } else {
            return parent::getId();
        }
    }

Usage Example

Example #1
0
 /**
  * Returns a hash representing this calendar.
  *
  * @return array  A simple hash.
  */
 public function toHash()
 {
     $owner = $GLOBALS['registry']->isAdmin();
     $hash = parent::toHash();
     $hash['id'] = $this->_resource->getId();
     $hash['name'] = $this->name();
     $hash['owner'] = $owner;
     $hash['show'] = $this->display();
     $hash['edit'] = $this->hasPermission(Horde_Perms::EDIT);
     $hash['sub'] = null;
     $hash['feed'] = null;
     $hash['embed'] = null;
     $hash['members'] = $this->_resource->get('members');
     if ($owner) {
         $hash['perms'] = array('type' => 'matrix', 'default' => 0, 'guest' => 0, 'creator' => 0);
     }
     return $hash;
 }