示例#1
0
 /**
  * @param array $response
  * @return TpDataApiResponse
  * @throws TpInvalidSignatureException
  */
 public static function createFromResponse(array $response)
 {
     $keys = array('merchantId');
     $data = TpUtils::filterKeys($response, $keys);
     $instance = new static($data);
     return $instance;
 }
示例#2
0
 /**
  * TpAbstractModel constructor.
  *
  * @param array $data
  */
 public function __construct(array $data = array())
 {
     $keys = static::keys();
     $filtered = TpUtils::filterKeys($data, $keys);
     foreach ($filtered as $key => $value) {
         $this[$key] = $value;
     }
     unset($value);
 }