本文整理汇总了PHP中Message::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Message::__construct方法的具体用法?PHP Message::__construct怎么用?PHP Message::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Message
的用法示例。
在下文中一共展示了Message::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor for SAML 2 response messages.
*
* @param string $tagName The tag name of the root element.
* @param \DOMElement|null $xml The input message.
* @throws \Exception
*/
protected function __construct($tagName, \DOMElement $xml = null)
{
parent::__construct($tagName, $xml);
$this->status = array('Code' => Constants::STATUS_SUCCESS, 'SubCode' => null, 'Message' => null);
if ($xml === null) {
return;
}
if ($xml->hasAttribute('InResponseTo')) {
$this->inResponseTo = $xml->getAttribute('InResponseTo');
}
$status = Utils::xpQuery($xml, './saml_protocol:Status');
if (empty($status)) {
throw new \Exception('Missing status code on response.');
}
$status = $status[0];
$statusCode = Utils::xpQuery($status, './saml_protocol:StatusCode');
if (empty($statusCode)) {
throw new \Exception('Missing status code in status element.');
}
$statusCode = $statusCode[0];
$this->status['Code'] = $statusCode->getAttribute('Value');
$subCode = Utils::xpQuery($statusCode, './saml_protocol:StatusCode');
if (!empty($subCode)) {
$this->status['SubCode'] = $subCode[0]->getAttribute('Value');
}
$message = Utils::xpQuery($status, './saml_protocol:StatusMessage');
if (!empty($message)) {
$this->status['Message'] = trim($message[0]->textContent);
}
}
示例2: __construct
/**
* MessageEcho constructor.
*
* @param bool $isEcho
* @param int $appId
* @param string $id
* @param int $sequence
* @param null|string $metadata
* @param null|string $text
* @param array $attachments
*/
public function __construct($isEcho, $appId, $id, $sequence, $metadata = null, $text = null, array $attachments = [])
{
parent::__construct($id, $sequence, $text, $attachments);
$this->isEcho = $isEcho;
$this->appId = $appId;
$this->metadata = $metadata;
}
示例3: __construct
/**
* ReplyToMessage constructor.
*
* @param array $data
* @param string $bot_name
*
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public function __construct(array $data, $bot_name = '')
{
//As explained in the documentation
//Reply to message can't contain other reply to message entities
unset($data['reply_to_message']);
parent::__construct($data, $bot_name);
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->BindSetting(Protocl::$byteOrder, Moudle::$Auth);
$this->code = 0;
$this->city = "Beijing";
}
示例5: __construct
public function __construct($status = 200, array $headers = array(), Stream $body, $protocol = '1.1', $reason = null)
{
parent::__construct($headers, $body, $protocol);
$this->statuses = array(100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authorative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 208 => 'Already Reported', 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Switch Proxy', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Request Range Not Satisfied', 417 => 'Expectation Failed', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout');
$this->status = $status;
$this->reasonPhrase = $reason;
}
示例6: __construct
/**
* Create a new SMS text message.
*
* @param string $to
* @param string $from
* @param string $title
* @param string $url
* @param int $validity
*/
public function __construct($to, $from, $title, $url, $validity)
{
parent::__construct($to, $from);
$this->title = (string) $title;
$this->url = (string) $url;
$this->validity = (int) $validity;
}
示例7:
function __construct($requestId, $options, $topicName)
{
parent::__construct();
$this->options = $options;
$this->topicName = $topicName;
$this->setRequestId($requestId);
}
示例8: __construct
public function __construct($data, $connection)
{
parent::__construct($data, $connection);
$cache = \Cache::get($connection->session);
$this->message = strip_tags($data->message);
$this->nickname = $cache['nickname'];
}
示例9: __construct
/**
* @param ConnectionInterface $connection
* @param int $format notification format, defaults to 2
* @throws CException
*/
public function __construct(ConnectionInterface &$connection, $format = self::FORMAT_DEFAULT)
{
parent::__construct($connection);
if (!in_array($format, [self::FORMAT_SIMPLE, self::FORMAT_ENHANCED, self::FORMAT_DEFAULT])) {
throw new CException('Unknown message format.');
}
$this->_format = $format;
}
示例10: __construct
public function __construct()
{
$this->notify_id = 0;
$this->notify_type = -1;
$this->payload = '';
$this->restricted_package_name = Constants::$packageName;
parent::__construct();
}
示例11: __construct
public function __construct(array $params, $toUser)
{
#-------------------------------------------------------------------------------
parent::__construct('DomainOrdersOnRegister', $toUser);
#-------------------------------------------------------------------------------
$this->setParams($params);
#-------------------------------------------------------------------------------
}
示例12: __construct
/**
* Creates a new guestbook comment object.
*
* @param integer $commentID
* @param array $row
*/
public function __construct($entryID, $row = null)
{
if ($entryID !== null) {
$sql = "SELECT\t\tcomment.*\n\t\t\t\tFROM\t\twcf" . WCF_N . "_user_guestbook_comment comment\n\t\t\t\tWHERE\t\tcomment.commentID = " . $commentID;
$row = WCF::getDB()->getFirstRow($sql);
}
parent::__construct($row);
}
示例13: __construct
public function __construct($id = 0)
{
parent::__construct();
if ($id) {
if (!$this->charger_id($id)) {
throw new TheliaAdminException("Message not found", TheliaAdminException::MESSAGE_NOT_FOUND);
}
}
}
示例14: __construct
/**
* Creates a new guestbook entry object.
*
* @param integer $entryID
* @param array $row
*/
public function __construct($entryID, $row = null)
{
if ($entryID !== null) {
$sql = "SELECT\t\tentry.*,\n\t\t\t\t\t\tCOUNT(comment.commentID) AS commentCount,\n\t\t\t\t\t\tGROUP_CONCAT(comment.commentID ORDER BY comment.commentID ASC SEPARATOR ',') AS commentIDs\n\t\t\t\tFROM\t\twcf" . WCF_N . "_user_guestbook_entry entry\n\t\t\t\tLEFT JOIN\twcf" . WCF_N . "_user_guestbook_comment comment\n\t\t\t\tON\t\t(entry.entryID = comment.entryID)\n\t\t\t\tWHERE\t\tentry.entryID = " . $entryID;
$row = WCF::getDB()->getFirstRow($sql);
}
$this->commentList = new UserGuestbookCommentList();
parent::__construct($row);
}
示例15: __construct
/**
* Constructor
*
* @param int $requestId
* @param mixed $options
* @param string $topicName
* @param mixed $arguments
* @param mixed $argumentsKw
*/
public function __construct($requestId, $options, $topicName, $arguments = null, $argumentsKw = null)
{
parent::__construct();
$this->setRequestId($requestId);
$this->setArguments($arguments);
$this->setArgumentsKw($argumentsKw);
$this->setOptions($options);
$this->topicName = $topicName;
}