Ejemplo n.º 1
0
 protected function execute(array $arguments)
 {
     if (isset($arguments[0])) {
         $text = \ResText::findFirstByHash_id($arguments[0]);
         if ($text) {
             return $text->content;
         }
         return '';
     }
     throw new InvalidArgumentException('strings invalid');
 }
Ejemplo n.º 2
0
 /**
  * delete
  *
  * @return \Phalcon\Http\ResponseInterface
  */
 public function deleteAction()
 {
     $hash_id = $this->request->get('id', 'string', '');
     $res_text = ResText::findFirst(['hash_id = :hash_id: and user_id = :user_id:', 'bind' => ['hash_id' => $hash_id, 'user_id' => $this->current_user->id]]);
     if ($res_text) {
         $res_text->delete();
         // active
         UserActive::record('text-delete', $this->current_user->id);
     }
     return $this->response->redirect('text/lists');
 }