| @@ 762-783 (lines=22) @@ | ||
| 759 | /** |
|
| 760 | * @param string $idKey |
|
| 761 | */ |
|
| 762 | private function getCartMetadata($idKey) |
|
| 763 | { |
|
| 764 | $cartMetadata = new ClassMetadata( |
|
| 765 | 'carts', |
|
| 766 | 'Mapado\RestClientSdk\Tests\Model\JsonLd\Cart', |
|
| 767 | '' |
|
| 768 | ); |
|
| 769 | $cartMetadata->setAttributeList([ |
|
| 770 | new Attribute($idKey, 'id', 'string', true), |
|
| 771 | new Attribute('status'), |
|
| 772 | new Attribute('clientPhoneNumber', 'clientPhoneNumber', 'phone_number'), |
|
| 773 | new Attribute('createdAt', 'createdAt', 'datetime'), |
|
| 774 | new Attribute('cart_items', 'cartItemList'), |
|
| 775 | new Attribute('order'), |
|
| 776 | ]); |
|
| 777 | $cartMetadata->setRelationList([ |
|
| 778 | new Relation('cart_items', Relation::ONE_TO_MANY, 'Mapado\RestClientSdk\Tests\Model\JsonLd\CartItem'), |
|
| 779 | new Relation('order', Relation::MANY_TO_ONE, 'Mapado\RestClientSdk\Tests\Model\JsonLd\Order'), |
|
| 780 | ]); |
|
| 781 | ||
| 782 | return $cartMetadata; |
|
| 783 | } |
|
| 784 | ||
| 785 | /** |
|
| 786 | * createNewCart |
|
| @@ 951-974 (lines=24) @@ | ||
| 948 | return $orderMetadata; |
|
| 949 | } |
|
| 950 | ||
| 951 | private function getCartMetadata() |
|
| 952 | { |
|
| 953 | $cartMetadata = new ClassMetadata( |
|
| 954 | 'carts', |
|
| 955 | 'Mapado\RestClientSdk\Tests\Model\JsonLd\Cart', |
|
| 956 | '' |
|
| 957 | ); |
|
| 958 | ||
| 959 | $cartMetadata->setAttributeList([ |
|
| 960 | new Attribute('@id', 'id', 'string', true), |
|
| 961 | new Attribute('status'), |
|
| 962 | new Attribute('clientPhoneNumber', 'clientPhoneNumber', 'phone_number'), |
|
| 963 | new Attribute('createdAt', 'createdAt', 'datetime'), |
|
| 964 | new Attribute('cart_items', 'cartItemList'), |
|
| 965 | new Attribute('order'), |
|
| 966 | ]); |
|
| 967 | ||
| 968 | $cartMetadata->setRelationList([ |
|
| 969 | new Relation('cartItemList', Relation::ONE_TO_MANY, 'Mapado\RestClientSdk\Tests\Model\JsonLd\CartItem'), |
|
| 970 | new Relation('order', Relation::MANY_TO_ONE, 'Mapado\RestClientSdk\Tests\Model\JsonLd\Order'), |
|
| 971 | ]); |
|
| 972 | ||
| 973 | return $cartMetadata; |
|
| 974 | } |
|
| 975 | ||
| 976 | private function getCartItemMetadata() |
|
| 977 | { |
|