[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/restful/src/RESTful/Exceptions/ -> HTTPError.php (source)

   1  <?php
   2  
   3  namespace RESTful\Exceptions;
   4  
   5  /**
   6   * Indicates an HTTP level error has occurred. The underlying HTTP response is
   7   * stored as response member. The response payload fields if any are stored as
   8   * members of the same name.
   9   *
  10   * @see \Httpful\Response
  11   */
  12  class HTTPError extends Base
  13  {
  14      public $response;
  15  
  16      public function __construct($response)
  17      {
  18          $this->response = $response;
  19          $this->_objectify($this->response->body);
  20      }
  21  
  22      protected function _objectify($fields)
  23      {
  24          foreach ($fields as $key => $val) {
  25              $this->$key = $val;
  26          }
  27      }
  28  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1