当前位置: 首页>>代码示例>>PHP>>正文


PHP Comment::getText方法代码示例

本文整理汇总了PHP中Comment::getText方法的典型用法代码示例。如果您正苦于以下问题:PHP Comment::getText方法的具体用法?PHP Comment::getText怎么用?PHP Comment::getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Comment的用法示例。


在下文中一共展示了Comment::getText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetSet

 public function testGetSet()
 {
     $comment = new Comment('/* Some comment */', 1);
     $this->assertSame('/* Some comment */', $comment->getText());
     $this->assertSame('/* Some comment */', (string) $comment);
     $this->assertSame(1, $comment->getLine());
     $comment->setText('/* Some other comment */');
     $comment->setLine(10);
     $this->assertSame('/* Some other comment */', $comment->getText());
     $this->assertSame('/* Some other comment */', (string) $comment);
     $this->assertSame(10, $comment->getLine());
 }
开发者ID:saj696,项目名称:pipe,代码行数:12,代码来源:CommentTest.php

示例2: onNewComment

 public function onNewComment(FrontController $sender, Comment $comment, Statement $st)
 {
     $users = $st->getSubscribers();
     if ($users) {
         require_once ST_DIR . '/Classes/Mailer.php';
         $mailer = new Mailer();
         $vars = array('text' => strip_tags($comment->getText()), 'st_link' => FrontController::getURLByRoute('view', array('id' => $st->getId()), true), 'title' => $st->getTitle(), 'comment_user' => $comment->getUsername());
         foreach ($users as $user) {
             if ($user->user_id == $comment->getUserId() || $user->email == $comment->getEmail()) {
                 continue;
             }
             $vars['username'] = $user->name;
             $vars['unSubscribeLink'] = $this->_getSubscribeLink($user->email, $user->user_id, $st->getId());
             $mailer->sendMail('SubscribeNewComment', $user->email, $vars);
         }
     }
     $user = FrontController::getUser();
     if (!$user->user_id) {
         $guest = clone $user;
         $guest->email = $comment->getEmail();
         $guest->name = $comment->getUsername();
         $this->_subscribe($st, $guest);
     } else {
         $this->_subscribe($st, $user);
     }
 }
开发者ID:dautushenka,项目名称:DLE-Statement,代码行数:26,代码来源:SubscribeEvent.php

示例3: renderComment

 public function renderComment(Comment $comm, $template)
 {
     $vars = array('id' => $comm->getId(), 'username' => $comm->getUsername(), 'text' => $comm->getText(), 'date' => date('j.m.Y H:i', $comm->getDate()), 'ip' => $comm->getIpAddress());
     $user = FrontController::getUser();
     $config = FrontController::$config;
     if (in_array($this->_user->user_group, $config['moder_groups']) || in_array($this->_user->user_id, $config['moders']) || ($user->user_id == $comm->getUserId() && $comm->getUserId() || $user->ip_address == $comm->getIpAddress() && $comm->getDate() > time() - $config['owner_comment_del_time'])) {
         $blocks['perm_del'] = true;
     }
     return $this->render($template, $vars, $blocks);
 }
开发者ID:dautushenka,项目名称:DLE-Statement,代码行数:10,代码来源:Views.php

示例4: testGetText

 public function testGetText()
 {
     $comment = new Comment('c');
     $this->assertEquals("c", $comment->getText());
 }
开发者ID:romanpitak,项目名称:Nginx-Config-Processor,代码行数:5,代码来源:CommentTest.php

示例5: _writeComment

 /**
  * Write comment to XML format
  *
  * @param 	Shared_XMLWriter		$objWriter 			XML Writer
  * @param	string							$pCellReference		Cell reference
  * @param 	Comment				$pComment			Comment
  * @param	array							$pAuthors			Array of authors
  * @throws 	Exception
  */
 public function _writeComment(Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', Comment $pComment = null, $pAuthors = null)
 {
     // comment
     $objWriter->startElement('comment');
     $objWriter->writeAttribute('ref', $pCellReference);
     $objWriter->writeAttribute('authorId', $pAuthors[$pComment->getAuthor()]);
     // text
     $objWriter->startElement('text');
     $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $pComment->getText());
     $objWriter->endElement();
     $objWriter->endElement();
 }
开发者ID:kamaludinnur,项目名称:toko-baju,代码行数:21,代码来源:Comments.php

示例6: onEditComment

 /**
  * This event is trigered when comment that belongs to this object is updated
  *
  * @param Comment $comment
  * @return boolean
  */
 function onEditComment(Comment $comment)
 {
     if ($this->isSearchable()) {
         SearchableObjects::dropContentByObjectColumn($this, 'comment' . $comment->getId());
         $searchable_object = new SearchableObject();
         $searchable_object->setRelObjectId($this->getObjectId());
         $searchable_object->setColumnName('comment' . $comment->getId());
         $searchable_object->setContent($comment->getText());
         $searchable_object->save();
     }
     return true;
 }
开发者ID:rorteg,项目名称:fengoffice,代码行数:18,代码来源:ContentDataObject.class.php

示例7: onNewComment

 public function onNewComment(FrontController $sender, Comment $comment, Statement $st)
 {
     $vars = array('username' => $comment->getUsername(), 'text' => strip_tags($comment->getText()), 'st_link' => FrontController::getURLByRoute('@view', array('id' => $st->getId()), true), 'title' => $st->getTitle());
     $this->getMailer()->sendMail('newComment', $this->_getModerEmails(), $vars);
 }
开发者ID:dautushenka,项目名称:DLE-Statement,代码行数:5,代码来源:MailsEvent.php


注:本文中的Comment::getText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。