• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AbstractResponse类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getHttpResponse

 /**
  * (non-PHPdoc)
  * @see \InoOicServer\OpenIdConnect\Response\AbstractResponse::getHttpResponse()
  * @return \Zend\Http\Response
  */
 public function getHttpResponse()
 {
     $httpResponse = parent::getHttpResponse();
     $httpResponse->getHeaders()->addHeaders(array('Content-Type' => 'application/json'));
     if ($this->isError()) {
         $httpResponse->setStatusCode($this->_errorHttpStatusCode);
         $httpResponse->setContent($this->_createErrorResponseContent());
     } else {
         $httpResponse->setContent($this->_createResponseContent());
     }
     return $httpResponse;
 }
开发者ID:ivan-novakov,项目名称:zf2-openid-connect-server-module,代码行数:17,代码来源:AbstractTokenResponse.php


示例2: __construct

 /**
  * Constructor 
  * 
  * @access public
  * @param unknown_type $url
  * @param array $headers
  * @param unknown_type $response
  * @param unknown_type $responseCode
  * @param unknown_type $responseMessage
  * @constructor
  * @return void
  */
 public function __construct($url, array $headers, $response, $responseCode, $responseMessage)
 {
     parent::__construct($url, $headers, $response);
     $this->responseCode = $responseCode;
     $this->responseMessage = $responseMessage;
     $this->_parseHeaders($headers);
 }
开发者ID:oxymore,项目名称:blizzard-api,代码行数:19,代码来源:CurlResponse.php


示例3: __construct

 public function __construct($data)
 {
     parent::__construct($data);
     foreach ($this->data['trackings'] as $courier) {
         $this->trackings[] = new TrackingInfoShortResponse(array('result' => $courier));
     }
 }
开发者ID:Acidter,项目名称:client-php,代码行数:7,代码来源:TrackingListResponse.php


示例4: __construct

 public function __construct($data)
 {
     parent::__construct($data);
     foreach ($this->data as $courier) {
         $this->couriers[] = new CourierResponse(array('result' => $courier));
     }
 }
开发者ID:Acidter,项目名称:client-php,代码行数:7,代码来源:CourierListResponse.php


示例5:

 /**
  * @param $data
  */
 function __construct($data)
 {
     if (is_object($data)) {
         $this->obj = $data;
     } else {
         if (is_string($data)) {
             parent::__construct($data);
         }
     }
     if (isset($this->obj->username)) {
         $this->username = $this->obj->username;
     }
     if (isset($this->obj->limit)) {
         $this->limit = $this->obj->limit;
     }
     if (isset($this->obj->month_limit)) {
         $this->monthLimit = $this->obj->month_limit;
     }
     if (isset($this->obj->senders)) {
         $this->senders = $this->obj->senders;
     }
     if (isset($this->obj->phonebook)) {
         $this->phonebook = $this->obj->phonebook;
     }
     if (isset($this->obj->active)) {
         $this->active = $this->obj->active;
     }
     if (isset($this->obj->info)) {
         $this->info = $this->obj->info;
     }
 }
开发者ID:TMSolution,项目名称:SmsBundle,代码行数:34,代码来源:UserResponse.php


示例6: __construct

 public function __construct($data)
 {
     parent::__construct($data);
     if ($this->data['last_checkpoint']) {
         $this->lastCheckpoint = new CheckpointResponse(array('result' => $this->data['last_checkpoint']));
     }
 }
开发者ID:Acidter,项目名称:client-php,代码行数:7,代码来源:TrackingInfoShortResponse.php


示例7: parseResponse

 public function parseResponse()
 {
     parent::parseResponse();
     if (!$this->wasSuccessful()) {
         return;
     }
     $hits = $this->parsedData->hits->hit;
     if (0 === count($hits)) {
         $this->hits = null;
         return;
     }
     $returnHits = array();
     foreach ($hits as $hit) {
         if (isset($hit->data)) {
             $returnHits[$hit->id] = $hit->data;
         } else {
             $returnHits[$hit->id] = $hit->id;
         }
     }
     foreach ($returnHits as $key => $hit) {
         if (is_object($hit)) {
             foreach ($hit as $dataKey => $data) {
                 $returnHits[$key]->{$dataKey} = !empty($data) ? $data[0] : null;
             }
         }
     }
     $this->hits = $returnHits;
 }
开发者ID:markwilson,项目名称:awscloudsearchphp,代码行数:28,代码来源:SearchResponse.php


示例8: getETag

 public function getETag()
 {
     $eTag = parent::getETag();
     if ($eTag === null) {
         $eTag = md5($this->string);
     }
     return $eTag;
 }
开发者ID:riimu,项目名称:kit-fileresponse,代码行数:8,代码来源:StringResponse.php


示例9: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($parameters)
 {
     parent::__construct($parameters);
     $this->status = $this->filteredParameters['STATUS'];
     if (array_key_exists('REMISE', $this->filteredParameters)) {
         $this->discount = $this->filteredParameters['REMISE'];
     }
 }
开发者ID:nexylan,项目名称:paybox-direct,代码行数:11,代码来源:InquiryResponse.php


示例10: foreach

 /**
  * @param $data
  */
 function __construct($data)
 {
     parent::__construct($data);
     $this->list = new \ArrayObject();
     if (isset($this->obj)) {
         foreach ($this->obj as $res) {
             $this->list->append(new SenderResponse($res));
         }
     }
 }
开发者ID:kaloryfer,项目名称:smsapi-php-client,代码行数:13,代码来源:SendersResponse.php


示例11: __construct

 public function __construct($data)
 {
     parent::__construct($data);
     if (isset($this->obj->proCount)) {
         $this->proCount = $this->obj->proCount;
     }
     if (isset($this->obj->ecoCount)) {
         $this->ecoCount = $this->obj->ecoCount;
     }
 }
开发者ID:smsapicom,项目名称:smsapicom-php-client,代码行数:10,代码来源:PointsResponse.php


示例12: __construct

 public function __construct($data)
 {
     parent::__construct($data);
     foreach ($this->data['checkpoints'] as $checkpoint) {
         $this->checkpoints[] = new CheckpointResponse(array('result' => $checkpoint));
     }
     foreach ($this->data['extra'] as $extra) {
         $this->extra[] = new TrackingExtraResponse(array('result' => $extra));
     }
 }
开发者ID:Acidter,项目名称:client-php,代码行数:10,代码来源:TrackingInfoResponse.php


示例13: chunk

 /**
  * Enable response chunking
  *
  * @link https://github.com/chriso/klein.php/wiki/Response-Chunking
  * @link http://bit.ly/hg3gHb
  * @param string $str   An optional string to send as a response "chunk"
  * @access public
  * @return Response
  */
 public function chunk($str = null)
 {
     parent::chunk();
     if (null !== $str) {
         printf("%x\r\n", strlen($str));
         echo "{$str}\r\n";
         flush();
     }
     return $this;
 }
开发者ID:jiangshengjun,项目名称:klein.php,代码行数:19,代码来源:Response.php


示例14:

 /**
  * @param $data
  */
 function __construct($data)
 {
     parent::__construct($data);
     if (isset($this->obj->error)) {
         $this->code = $this->obj->error;
     }
     if (isset($this->obj->message)) {
         $this->message = $this->obj->message;
     }
 }
开发者ID:TMSolution,项目名称:SmsBundle,代码行数:13,代码来源:ErrorResponse.php


示例15: deliverPayLoad

 /**
  * @return $this
  * @throws \Exception
  */
 public function deliverPayLoad()
 {
     $this->addHeader('Content-Type: application/json');
     if ($this->json) {
         $this->addBodyFragment($this->json);
     } else {
         throw new \Exception("No JSON", 500);
     }
     return parent::deliverPayLoad();
 }
开发者ID:borbyu,项目名称:wrr,代码行数:14,代码来源:JsonResponse.php


示例16: __construct

 public function __construct($step_number, $step_title, Template $view)
 {
     $this->load_language_resources();
     $this->init_response($step_number, $view);
     $env = new InstallDisplayGraphicalEnvironment();
     $this->add_language_bar();
     $this->init_steps();
     $this->update_progress_bar();
     $this->full_view->put_all(array('RESTART' => InstallUrlBuilder::welcome()->rel(), 'STEP_TITLE' => $step_title, 'C_HAS_PREVIOUS_STEP' => false, 'C_HAS_NEXT_STEP' => false, 'L_XML_LANGUAGE' => LangLoader::get_message('xml_lang', 'main'), 'PROGRESSION' => floor(100 * $this->current_step / ($this->nb_steps - 1)), 'PHPBOOST_VERSION' => GeneralConfig::load()->get_phpboost_major_version()));
     parent::__construct($env, $this->full_view);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:InstallDisplayResponse.class.php


示例17: __construct

 public function __construct($step_number, $step_title, Template $view)
 {
     $this->load_language_resources();
     $this->init_response($step_number, $view);
     $env = new UpdateDisplayGraphicalEnvironment();
     $this->add_language_bar();
     $this->init_steps();
     $this->update_progress_bar();
     $this->full_view->put_all(array('RESTART' => UpdateUrlBuilder::introduction()->rel(), 'STEP_TITLE' => $step_title, 'C_HAS_PREVIOUS_STEP' => false, 'C_HAS_NEXT_STEP' => false, 'L_XML_LANGUAGE' => LangLoader::get_message('xml_lang', 'main'), 'PROGRESSION' => floor(100 * $this->current_step / $this->nb_steps)));
     parent::__construct($env, $this->full_view);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:UpdateDisplayResponse.class.php


示例18: getETag

 public function getETag()
 {
     $eTag = parent::getETag();
     if ($eTag === null) {
         if ($this->md5) {
             $eTag = md5_file($this->path);
         } else {
             $eTag = sprintf('%x-%x', filesize($this->path), filemtime($this->path));
         }
     }
     return $eTag;
 }
开发者ID:riimu,项目名称:kit-fileresponse,代码行数:12,代码来源:FileResponse.php


示例19: __construct

 /**
  * @param string $json
  */
 public function __construct($json)
 {
     $pagination = json_decode($json, true);
     if (!empty($pagination['links'])) {
         $headerLinks = [];
         foreach ($this->links as $linkName => $relName) {
             if (!empty($pagination['links'][$linkName]['href'])) {
                 $headerLinks[] = sprintf('<%s>; rel="%s"', $pagination['links'][$linkName]['href'], $relName);
             }
         }
         if (!empty($headerLinks)) {
             $this->headers['Link'] = implode(', ', $headerLinks);
         }
     }
     parent::__construct($json);
 }
开发者ID:marcogrueter,项目名称:jsonapi-transformer,代码行数:19,代码来源:Response.php


示例20: __construct

 /**
  *
  * @param array $response
  * @return void
  */
 public function __construct($response = array())
 {
     if (isset($response['data'])) {
         parent::__construct($response);
         $data = $response['data'];
     } else {
         $data = $response;
     }
     $this->_uuid = isset($data['uuid']) ? $data['uuid'] : null;
     $this->_isValid = isset($data['isValid']) ? $data['isValid'] : false;
     $this->_usedAt = isset($data['usedAt']) ? $data['usedAt'] : null;
     $this->_activatedAt = isset($data['activatedAt']) ? $data['activatedAt'] : null;
     $this->_expiresAt = isset($data['expiresAt']) ? $data['expiresAt'] : null;
     if (isset($data['coupon'])) {
         $couponData = $data['coupon'];
         $couponData['uuid'] = $this->_uuid;
         $this->_coupon = new Coupon(array('data' => $couponData));
     }
 }
开发者ID:Synerise,项目名称:PHP-SDK,代码行数:24,代码来源:ActiveCoupon.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AbstractResponseType类代码示例发布时间:2022-05-23
下一篇:
PHP AbstractRequestType类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap