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


PHP AbstractResponse类代码示例

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


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


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