diff options
Diffstat (limited to 'application/models/BootMenuEntriesMapper.php')
| -rw-r--r-- | application/models/BootMenuEntriesMapper.php | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/application/models/BootMenuEntriesMapper.php b/application/models/BootMenuEntriesMapper.php index 576e799..468825e 100644 --- a/application/models/BootMenuEntriesMapper.php +++ b/application/models/BootMenuEntriesMapper.php @@ -1,7 +1,8 @@ <?php -class Application_Model_BootEntriesMapper +class Application_Model_BootMenuEntriesMapper { + protected $_dbTable; public function setDbTable($dbTable) @@ -22,24 +23,18 @@ class Application_Model_BootEntriesMapper public function getDbTable() { if (null === $this->_dbTable) { - $this->setDbTable('Application_Model_DbTable_TABLENAME'); + $this->setDbTable('Application_Model_DbTable_Person'); } return $this->_dbTable; } - public function save(Application_Model_TABLENAME $tablenamevar) + public function save(Application_Model_BootMenuEntries $botmenuentries) { - $data = array( - 'bootosID' => $tablenamevar->getBootosID(), - 'bootmenuID' => $tablenamevar->getMenuID(), - 'title' => $tablenamevar->getTitle(), - 'kcl' => $tablenamevar->getKcl(), - 'order' => $tablenamevar->getOrder() - ); + $data = array('bootosID'=> $botmenuentries->getBootosID() ,'bootmenuID'=> $botmenuentries->getBootmenuID() ,'title'=> $botmenuentries->getTitle() ,'kcl'=> $botmenuentries->getKcl() ,'order'=> $botmenuentries->getOrder() ); - if (null === ($id = $tablenamevar->getId()) ) { + if (null === ($id = $botmenuentries->getID()) ) { unset($data['id']); $this->getDbTable()->insert($data); } else { @@ -47,7 +42,7 @@ class Application_Model_BootEntriesMapper } } - public function find($id, Application_Model_TABLENAME $tablenamevar) + public function find($id, Application_Model_BootMenuEntries $botmenuentries) { $result = $this->getDbTable()->find($id); if (0 == count($result)) { @@ -56,10 +51,7 @@ class Application_Model_BootEntriesMapper $row = $result->current(); - $tablenamevar->setId($row->id) - ->setEmail($row->email) - ->setComment($row->comment) - ->setCreated($row->created); + $botmenuentries->setBootosID($row->bootosID)->setBootmenuID($row->bootmenuID)->setTitle($row->title)->setKcl($row->kcl)->setOrder($row->order); } public function fetchAll() @@ -67,17 +59,17 @@ class Application_Model_BootEntriesMapper $resultSet = $this->getDbTable()->fetchAll(); $entries = array(); foreach ($resultSet as $row) { - $entry = new Application_Model_TABLENAME(); - - $entry->setId($row->id) - ->setEmail($row->email) - ->setComment($row->comment) - ->setCreated($row->created); + $entry = new Application_Model_BootMenuEntries(); + $entry->setBootosID($row->bootosID)->setBootmenuID($row->bootmenuID)->setTitle($row->title)->setKcl($row->kcl)->setOrder($row->order); + $entries[] = $entry; } return $entries; } + + + } |
