Example #1
0
 public function findPost($data)
 {
     $form = $this->getForm();
     if ($form->isValid($data)) {
         $page = isset($data['page']) ? $data['page'] : 1;
         $mapper = Keplin_Model_Mapper_Factory::create('Post', $this->_enable_caching);
         $this->_searchResults = $mapper->query($data, $page);
     }
 }
Example #2
0
 public function authenticate()
 {
     $user = $this->_user;
     $mapper = Keplin_Model_Mapper_Factory::create('User');
     $mapper->login($user);
     if ($user->id) {
         $result = new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $user);
     } else {
         $result = new Zend_Auth_Result(Zend_Auth_Result::FAILURE, null);
     }
     return $result;
 }
Example #3
0
 public function getArchive($year, $page = 1)
 {
     $mapper = Keplin_Model_Mapper_Factory::create('Post', $this->_enable_caching);
     $mapper->is_published = 1;
     $posts = $mapper->getFromArchive($year, $page);
     return $posts;
 }
Example #4
0
 public function delete($comment_id)
 {
     $mapper = Keplin_Model_Mapper_Factory::create('Comment', $this->_enable_caching);
     $mapper->delete($comment_id);
 }