本文整理汇总了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;
}
示例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);
}
示例3: setChat
public function setChat(Chat $chat)
{
$this->setValue('chat', $chat->getId());
}
示例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;
}
}