Exemplo n.º 1
0
 /**
  * @param array $data
  * @return bool|mixed
  */
 public function post(array $data)
 {
     if (isset($data['wall_owner_id']) && isset($data['wall_owner_type']) && !empty($data['wall_owner_id']) && !empty($data['wall_owner_type'])) {
         $walls = new Walls();
         $wallid = $walls->getWallId($data['wall_owner_id'], $data['wall_owner_type']);
         $notification = new Notifier();
         $notification->notify($data['wall_owner_id'], $_SESSION['user']->userid, 'wall_post', 'index.php?m=wall_post&action=' . $data['wall_owner_id']);
     } else {
         $wallid = $_POST['wallid'];
     }
     $res = $this->insert(["userid" => $data['userid'], "wall_id" => $wallid, "privacy" => $data['privacy'], "content" => $data['content'], "time" => new \Zend_Db_Expr("UTC_TIMESTAMP()"), "type" => $data['type']]);
     if ($res !== null) {
         return $this->getPostData($res);
     } else {
         return false;
     }
 }