setMessage() public method

public setMessage ( $message )
示例#1
0
  public function load($id) {
    $result=HypertableConnection::query("SELECT * FROM tweet ".
                "WHERE ROW='$id'");
    if (!$result or !count($result->cells))
      return null;

    $tweet=new Tweet();
    $tweet->setId($id);
    $tweet->setTimestamp($result->cells[0]->key->timestamp);
    $tweet->setMessage($result->cells[0]->value);
    return $tweet;
  }
 public function sendAction()
 {
     $request = $this->getRequest();
     // Check if we have a POST request
     if (!$request->isPost()) {
         return $this->_helper->redirector('index', 'index');
     }
     // Get our form and validate it
     $form = $this->getSendForm();
     if (!$form->isValid($request->getPost())) {
         $this->view->form = $form;
         $val = $form->getValues();
         return $this->_helper->redirector->gotoUrl($val['goto']);
     }
     $val = $form->getValues();
     // create a tweet and store it in the Database
     $profile = Zend_Auth::getInstance()->getIdentity();
     $t = new Tweet();
     $t->setMessage($val['message']);
     TweetTable::store($t, $profile->getId());
     // then redirect to the previous page
     return $this->_helper->redirector->gotoUrl($val['goto']);
 }