summaryrefslogtreecommitdiffstats
path: root/application/models/Client.php
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-17 21:37:57 +0200
committerBjörn Geiger2011-08-17 21:37:57 +0200
commit850b7e057b7579c1fc4bc553bc6198f404dc79d2 (patch)
tree24f95c22f1bf5916b23556c90be45f62c1dc1a84 /application/models/Client.php
parentClient nun mit ip bzw. ip6 (diff)
downloadpoolctrl-850b7e057b7579c1fc4bc553bc6198f404dc79d2.tar.gz
poolctrl-850b7e057b7579c1fc4bc553bc6198f404dc79d2.tar.xz
poolctrl-850b7e057b7579c1fc4bc553bc6198f404dc79d2.zip
Models noch verändert
Diffstat (limited to 'application/models/Client.php')
-rw-r--r--application/models/Client.php70
1 files changed, 45 insertions, 25 deletions
diff --git a/application/models/Client.php b/application/models/Client.php
index e8108ef..19ddb0d 100644
--- a/application/models/Client.php
+++ b/application/models/Client.php
@@ -15,6 +15,8 @@ class Application_Model_Client
protected $_clientID;
protected $_groupID;
protected $_macadress;
+ protected $_ip;
+ protected $_ip6;
protected $_hardwarehash;
protected $_created;
@@ -83,6 +85,24 @@ class Application_Model_Client
$this->_macadress = $_macadress;
return $this;
}
+ public function getIp()
+ {
+ return $this->_ip;
+ }
+ public function setIp($_ip)
+ {
+ $this->_ip = $_ip;
+ return $this;
+ }
+ public function getIp6()
+ {
+ return $this->_ip6;
+ }
+ public function setIp6($_ip6)
+ {
+ $this->_ip6 = $_ip6;
+ return $this;
+ }
public function getHardwarehash()
{
return $this->_hardwarehash;
@@ -101,39 +121,39 @@ class Application_Model_Client
$this->_created = $_created;
return $this;
}
- /**
- * Returns current data as associative array using ReflectionClass
- *
- * @return array Returns associative array containing model data
+ /**
+ * 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;
+ }
}