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


PHP Chat::getId方法代码示例

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


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

示例1: getChatMessages

 /**
  * @param \Chat\Bundle\CommonBundle\Entity\Chat $chat
  * @param array $hashList
  * @return array
  */
 public function getChatMessages(Chat $chat, $hashList = array())
 {
     $messages = $this->_em->getConnection()->fetchAll('
         SELECT 
             cm.id,
             cm.hash,
             cm.content,
             cm.createAt,
             m.username,
             m.textColor,
             m.backgroundColor
         FROM
             `chat_message` cm
         LEFT JOIN
             `chat_member` m ON m.id = cm.member_id
         WHERE
             cm.`chat_id` = :chat_id
             AND cm.hash NOT IN (' . implode(',', $hashList) . ')
         ORDER BY
             cm.create_at ASC
     ', array('chat_id' => $chat->getId()));
     foreach ($messages as $key => $value) {
         $createAt = new \DateTime($value['create_at']);
         $value['create_at'] = $createAt->format('m.d.y g:i a');
         $messages[$key] = $value;
     }
     return $messages;
 }
开发者ID:alexeybob,项目名称:QuickChat,代码行数:33,代码来源:ChatRepository.php

示例2: editMessageReplyMarkup

 /**
  * @param Chat|null $chat
  * @param Message|null $message
  * @param Message|null $inlineMessage
  * @param AbstractKeyboard|null $replyMarkup Reply keyboard markup
  */
 public function editMessageReplyMarkup($chat = null, $message = null, $inlineMessage = null, AbstractKeyboard $replyMarkup = null)
 {
     $params = ['chat_id' => $chat instanceof Chat ? $chat->getId() : $chat, 'message_id' => $message instanceof Message ? $message->getMessageId() : $message, 'inline_message_id' => $inlineMessage instanceof Message ? $inlineMessage->getMessageId() : $inlineMessage, 'reply_markup' => $replyMarkup];
     $this->getNet()->doRequest('/editMessageReplyMarkup', $params);
 }
开发者ID:phptelegram,项目名称:api,代码行数:11,代码来源:UpdateMethodsTrait.php

示例3: setChat

 public function setChat(Chat $chat)
 {
     $this->setValue('chat', $chat->getId());
 }
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:4,代码来源:ChatMessage.php

示例4: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Chat $value A Chat object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Chat $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
开发者ID:nagiro,项目名称:intra,代码行数:22,代码来源:BaseChatPeer.php


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