コード例 #1
0
ファイル: Notice.php プロジェクト: a780201/gnu-social
 /**
  * Record a single hash tag as associated with this notice.
  * Tag format and uniqueness must be validated by caller.
  */
 function saveTag($hashtag)
 {
     $tag = new Notice_tag();
     $tag->notice_id = $this->id;
     $tag->tag = $hashtag;
     $tag->created = $this->created;
     $id = $tag->insert();
     if (!$id) {
         // TRANS: Server exception. %s are the error details.
         throw new ServerException(sprintf(_('Database error inserting hashtag: %s.'), $last_error->message));
         return;
     }
     // if it's saved, blow its cache
     $tag->blowCache(false);
 }