Kronolith_Resource_Group::get PHP Method

get() public method

Override the get method to see if we have a selected resource. If so, return the resource's property value, otherwise, return the group's property value.
public get ( string $property ) : mixed
$property string The property to get.
return mixed The requested property's value.
    public function get($property)
    {
        if (empty($this->_selectedResource)) {
            return parent::get($property);
        } else {
            return $this->_selectedResource->get($property);
        }
    }

Usage Example

示例#1
0
 /**
  * @throws Kronolith_Exception
  */
 public function execute()
 {
     if ($this->_vars->get('submitbutton') == _("Cancel")) {
         Horde::url($GLOBALS['prefs']->getValue('defaultview') . '.php', true)->redirect();
     }
     if (!$this->_resource->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) {
         throw new Kronolith_Exception(_("Permission denied"));
     }
     // Delete the resource.
     try {
         Kronolith::getDriver('Resource')->delete($this->_resource);
     } catch (Exception $e) {
         throw new Kronolith_Exception(sprintf(_("Unable to delete \"%s\": %s"), $this->_resource->get('name'), $e->getMessage()));
     }
 }
All Usage Examples Of Kronolith_Resource_Group::get