18 public function getDatas(?
string $model =
null): array {
20 if (\count ( $datas ) > 0) {
21 $datas = \current ( array_keys ( $datas ) );
22 $datas = \json_decode ( $datas,
true );
23 $attributes = $datas [
'data'] [
'attributes'] ?? [ ];
24 if (isset ( $datas [
'data'] [
'id'] ) && isset($model)) {
25 $key = OrmUtils::getFirstKey ( $model );
26 $attributes [$key] = $datas [
'data'] [
'id'];
35 if (isset ( $datas [
'data'] [
'relationships'] )) {
36 $relationShips = $datas [
'data'] [
'relationships'];
37 foreach ( $relationShips as $member => $data ) {
38 if (isset ( $data [
'data'] [
'id'])) {
39 $m = OrmUtils::getJoinColumnName ( $model, $member );
40 $attributes [$m] = $data [
'data'] [
'id'];