summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorSimon2011-03-10 13:30:30 +0100
committerSimon2011-03-10 13:30:30 +0100
commita4402a3b918aa347a770c2509822731fd08a45ee (patch)
tree4f388eb64710ead6d86a70b8c885ff3bdad7aebf /application
parentdefault kcl und config hinzugefuegt (diff)
downloadpbs2-a4402a3b918aa347a770c2509822731fd08a45ee.tar.gz
pbs2-a4402a3b918aa347a770c2509822731fd08a45ee.tar.xz
pbs2-a4402a3b918aa347a770c2509822731fd08a45ee.zip
Mapper wieder korrigiert && Controller ergänzt
Diffstat (limited to 'application')
-rw-r--r--application/layouts/main.phtml1
-rw-r--r--application/models/ConfigMapper.php13
-rw-r--r--application/models/GroupMapper.php13
-rw-r--r--application/models/MembershipMapper.php13
-rw-r--r--application/models/PersonMapper.php13
5 files changed, 41 insertions, 12 deletions
diff --git a/application/layouts/main.phtml b/application/layouts/main.phtml
index 57d09c7..ca09e42 100644
--- a/application/layouts/main.phtml
+++ b/application/layouts/main.phtml
@@ -25,6 +25,7 @@ echo $this->headScript()."\n";
<li><a href='/bootmenu'>BootMenu</a></li>
<li><a href='/config'>Config</a></li>
<li><a href='/bootos'>BootOs</a></li>
+ <li><a href='/resource'>Resource</a></li>
<li><a href='/client'>Client</a></li>
<li><a href='/filter'>Filter</a></li>
<li><a href='/pool'>Pool</a></li>
diff --git a/application/models/ConfigMapper.php b/application/models/ConfigMapper.php
index da7a073..d8a23c4 100644
--- a/application/models/ConfigMapper.php
+++ b/application/models/ConfigMapper.php
@@ -66,9 +66,14 @@ class Application_Model_ConfigMapper
}
}
- public function find($id)
+ public function find($id, Application_Model_Config $config = null)
{
- $config = new Application_Model_Config();
+ if($config == null){
+ $return = true;
+ }
+ if($return){
+ $config = new Application_Model_Config();
+ }
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
return;
@@ -77,7 +82,9 @@ class Application_Model_ConfigMapper
$row = $result->current();
$config->setID($row->configID)->setGroupID($row->groupID)->setMembershipID($row->membershipID)->setCreated($row->created)->setShellscript($row->shellscript)->setTitle($row->title);
- return $config;
+ if($return){
+ return $config;
+ }
}
public function fetchAll()
diff --git a/application/models/GroupMapper.php b/application/models/GroupMapper.php
index d43b3f1..463f3d1 100644
--- a/application/models/GroupMapper.php
+++ b/application/models/GroupMapper.php
@@ -66,9 +66,14 @@ class Application_Model_GroupMapper
}
}
- public function find($id)
+ public function find($id,Application_Model_Group $group = null)
{
- $group = new Application_Model_Group();
+ if($group == null){
+ $return = true;
+ }
+ if($return){
+ $group = new Application_Model_Group();
+ }
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
return;
@@ -77,7 +82,9 @@ class Application_Model_GroupMapper
$row = $result->current();
$group->setID($row->groupID)->setTitle($row->title)->setDescription($row->description);
- return $group;
+ if($return){
+ return $group;
+ }
}
public function fetchAll()
diff --git a/application/models/MembershipMapper.php b/application/models/MembershipMapper.php
index 2a6e57d..313248c 100644
--- a/application/models/MembershipMapper.php
+++ b/application/models/MembershipMapper.php
@@ -66,9 +66,14 @@ class Application_Model_MembershipMapper
}
}
- public function find($id)
+ public function find($id, Application_Model_Membership $membership = null)
{
- $membership = new Application_Model_Membership();
+ if($membership == null){
+ $return = true;
+ }
+ if($return){
+ $membership = new Application_Model_Membership();
+ }
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
return;
@@ -77,7 +82,9 @@ class Application_Model_MembershipMapper
$row = $result->current();
$membership->setID($row->membershipID)->setGroupID($row->groupID)->setRoleID($row->roleID)->setPersonID($row->personID);
- return $membership;
+ if($return){
+ return $membership;
+ }
}
public function fetchAll()
diff --git a/application/models/PersonMapper.php b/application/models/PersonMapper.php
index 038670d..b2cbf39 100644
--- a/application/models/PersonMapper.php
+++ b/application/models/PersonMapper.php
@@ -66,9 +66,14 @@ class Application_Model_PersonMapper
}
}
- public function find($id)
+ public function find($id,Application_Model_Person $person = null)
{
- $person = new Application_Model_Person();
+ if($person == null){
+ $return = true;
+ }
+ if($return){
+ $person = new Application_Model_Person();
+ }
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
return;
@@ -77,7 +82,9 @@ class Application_Model_PersonMapper
$row = $result->current();
$person->setID($row->personID)->setTitle($row->title)->setName($row->name)->setFirstname($row->firstname)->setStreet($row->street)->setHousenumber($row->housenumber)->setCity($row->city)->setPostalcode($row->postalcode)->setLogindate($row->logindate)->setRegisterdate($row->registerdate)->setEmail($row->email)->setLogin($row->login)->setPassword($row->password)->setPasswordSalt($row->password_salt);
- return $person;
+ if($return){
+ return $person;
+ }
}
public function fetchAll()