summaryrefslogtreecommitdiffstats
path: root/application/models
diff options
context:
space:
mode:
Diffstat (limited to 'application/models')
-rw-r--r--application/models/GroupGroupsMapper.php44
-rw-r--r--application/models/GroupRequestMapper.php4
-rw-r--r--application/models/Person.php2
3 files changed, 25 insertions, 25 deletions
diff --git a/application/models/GroupGroupsMapper.php b/application/models/GroupGroupsMapper.php
index d7f5095..181d12d 100644
--- a/application/models/GroupGroupsMapper.php
+++ b/application/models/GroupGroupsMapper.php
@@ -2,23 +2,23 @@
class Application_Model_GroupGroupsMapper
{
-
+
protected $_dbTable;
- public function findBy($criteria, $value)
- {
- try{
+ public function findBy($criteria, $value)
+ {
+ try{
$db = Zend_Db_Table::getDefaultAdapter();
- $select = $this->getDbTable()->select()
- ->from($this->_dbTable)
- ->where($criteria . ' = ?', $value);
+ $select = $this->getDbTable()->select()
+ ->from($this->_dbTable)
+ ->where($criteria . ' = ?', $value);
$stmt = $select->query();
$result = $stmt->fetchAll();
return $result;
- }catch (Zend_Exception $e) {
- echo "Error message 2: " . $e->getMessage() . "\n";
+ }catch (Zend_Exception $e) {
+ echo "Error message 2: " . $e->getMessage() . "\n";
}
- }
+ }
public function setDbTable($dbTable)
{
@@ -31,7 +31,7 @@ class Application_Model_GroupGroupsMapper
}
$this->_dbTable = $dbTable;
-
+
return $this;
}
@@ -40,23 +40,19 @@ class Application_Model_GroupGroupsMapper
if (null === $this->_dbTable) {
$this->setDbTable('Application_Model_DbTable_GroupGroups');
}
-
+
return $this->_dbTable;
}
public function save(Application_Model_GroupGroups $groupgroups)
{
-
+
$data = array('parentID'=> $groupgroups->getParentID() ,'groupID'=> $groupgroups->getGroupID() );
- if (null === ($id = $groupgroups->getID()) ) {
- unset($data['groupgroupsID']);
- $this->getDbTable()->insert($data);
- } else {
- $this->getDbTable()->update($data, array('groupgroupsID = ?' => $id));
- }
+ #Noch zu prüfen ob Eintrag schon vorhanden
+ $this->getDbTable()->insert($data);
}
-
+
public function delete(Application_Model_GroupGroups $groupgroups)
{
if (null === ($id = $groupgroups->getID()) ) {
@@ -74,7 +70,7 @@ class Application_Model_GroupGroupsMapper
}
$row = $result->current();
-
+
$groupgroups->setParentID($row->parentID)->setGroupID($row->groupID);
}
@@ -84,8 +80,8 @@ class Application_Model_GroupGroupsMapper
$entries = array();
foreach ($resultSet as $row) {
$entry = new Application_Model_GroupGroups();
-
- $entry->setParentID($row->parentID)->setGroupID($row->groupID);
+
+ $entry->setParentID($row->parentID)->setGroupID($row->groupID);
$entries[] = $entry;
}
@@ -93,6 +89,6 @@ class Application_Model_GroupGroupsMapper
}
-
+
}
diff --git a/application/models/GroupRequestMapper.php b/application/models/GroupRequestMapper.php
index aa83095..98143dd 100644
--- a/application/models/GroupRequestMapper.php
+++ b/application/models/GroupRequestMapper.php
@@ -66,7 +66,7 @@ class Application_Model_GroupRequestMapper
}
}
- public function find($id, Application_Model_GroupRequest $grouprequest)
+ public function find($id)
{
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
@@ -75,7 +75,9 @@ class Application_Model_GroupRequestMapper
$row = $result->current();
+ $grouprequest = new Application_Model_GroupRequest();
$grouprequest->setID($row->grouprequestID)->setGroupID($row->groupID)->setPersonID($row->personID)->setTime($row->time);
+ return $grouprequest;
}
public function fetchAll()
diff --git a/application/models/Person.php b/application/models/Person.php
index b4545e9..aea348d 100644
--- a/application/models/Person.php
+++ b/application/models/Person.php
@@ -45,6 +45,8 @@ class Application_Model_Person
public function setOptions(array $options)
{
$methods = get_class_methods($this);
+ $options['passwordSalt'] = $options['password_salt'];
+ unset($options['password_salt']);
foreach ($options as $key => $value) {
$method = 'set' . ucfirst($key);
if (in_array($method, $methods)) {