summaryrefslogtreecommitdiffstats
path: root/application/models/Role.php
diff options
context:
space:
mode:
authorBjörn Geiger2011-03-28 14:38:51 +0200
committerBjörn Geiger2011-03-28 14:38:51 +0200
commit49ebfec064bb6d7a732466fa2071778665beb184 (patch)
tree98895379ee4152b7312bc415cfc6e2f3dd305faf /application/models/Role.php
parentEinführung einer Rightcategory (diff)
downloadpbs2-49ebfec064bb6d7a732466fa2071778665beb184.tar.gz
pbs2-49ebfec064bb6d7a732466fa2071778665beb184.tar.xz
pbs2-49ebfec064bb6d7a732466fa2071778665beb184.zip
Einführung von Vererbung von Rollen
Diffstat (limited to 'application/models/Role.php')
-rw-r--r--application/models/Role.php60
1 files changed, 35 insertions, 25 deletions
diff --git a/application/models/Role.php b/application/models/Role.php
index 28f0af1..49ed377 100644
--- a/application/models/Role.php
+++ b/application/models/Role.php
@@ -6,6 +6,7 @@ class Application_Model_Role
protected $_groupID;
protected $_title;
protected $_description;
+ protected $_inheritance;
public function __construct(array $options = null)
{
@@ -81,39 +82,48 @@ class Application_Model_Role
$this->_description = $_description;
return $this;
}
- /**
- * Returns current data as associative array using ReflectionClass
- *
- * @return array Returns associative array containing model data
+ public function getInheritance()
+ {
+ return $this->_inheritance;
+ }
+ public function setInheritance($_inheritance)
+ {
+ $this->_inheritance = $_inheritance;
+ return $this;
+ }
+ /**
+ * Returns current data as associative array using ReflectionClass
+ *
+ * @return array Returns associative array containing model data
* If "get"-method not available (our primary keys) the function getID() is called
- */
- public function toArray()
- {
- $reflectionClass = new ReflectionClass($this);
- $properties = $reflectionClass->getProperties();
- $result = array();
- foreach ($properties as $property) {
- $key = $property->name;
- if (substr($key, 0, 1) != '_' && $this->$key !== null) {
- $method = 'get' . ucfirst($key);
- if ($reflectionClass->hasMethod($method)) {
- $result[$key] = $this->$method();
- } else {
- $result[$key] = $this->$key;
- }
- }
+ */
+ public function toArray()
+ {
+ $reflectionClass = new ReflectionClass($this);
+ $properties = $reflectionClass->getProperties();
+ $result = array();
+ foreach ($properties as $property) {
+ $key = $property->name;
+ if (substr($key, 0, 1) != '_' && $this->$key !== null) {
+ $method = 'get' . ucfirst($key);
+ if ($reflectionClass->hasMethod($method)) {
+ $result[$key] = $this->$method();
+ } else {
+ $result[$key] = $this->$key;
+ }
+ }
elseif(substr($key, 0, 1) == '_' && $this->$key !== null) {
$key = substr($key, 1);
- $method = 'get' . ucfirst($key);
+ $method = 'get' . ucfirst($key);
if ($reflectionClass->hasMethod($method)) {
$result[$key] = $this->$method();
}else{
$result[$key] = $this->getID();
}
-
+
}
- }
- return $result;
- }
+ }
+ return $result;
+ }
}