Skip to content

Commit 120369d

Browse files
committed
Support hydrate
1 parent 8af2195 commit 120369d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ApiRequest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22
namespace Fortifi\Api\Core;
33

4+
use Packaged\Helpers\ValueAs;
5+
46
class ApiRequest implements IApiRequest
57
{
68
/**
@@ -173,4 +175,11 @@ public function shouldThrowExceptions()
173175
return $this->_throw;
174176
}
175177

178+
public function hydrate($data)
179+
{
180+
$this->_decoded = ValueAs::obj($data);
181+
$this->_result = json_encode($this->_decoded);
182+
return $this;
183+
}
184+
176185
}

0 commit comments

Comments
 (0)