@@ 763-784 (lines=22) @@ | ||
760 | /** |
|
761 | * @param string $idKey |
|
762 | */ |
|
763 | private function getCartMetadata($idKey) |
|
764 | { |
|
765 | $cartMetadata = new ClassMetadata( |
|
766 | 'carts', |
|
767 | 'Mapado\RestClientSdk\Tests\Model\JsonLd\Cart', |
|
768 | '' |
|
769 | ); |
|
770 | $cartMetadata->setAttributeList([ |
|
771 | new Attribute($idKey, 'id', 'string', true), |
|
772 | new Attribute('status'), |
|
773 | new Attribute('clientPhoneNumber', 'clientPhoneNumber', 'phone_number'), |
|
774 | new Attribute('createdAt', 'createdAt', 'datetime'), |
|
775 | new Attribute('cart_items', 'cartItemList'), |
|
776 | new Attribute('order'), |
|
777 | ]); |
|
778 | $cartMetadata->setRelationList([ |
|
779 | new Relation('cart_items', Relation::ONE_TO_MANY, 'Mapado\RestClientSdk\Tests\Model\JsonLd\CartItem'), |
|
780 | new Relation('order', Relation::MANY_TO_ONE, 'Mapado\RestClientSdk\Tests\Model\JsonLd\Order'), |
|
781 | ]); |
|
782 | ||
783 | return $cartMetadata; |
|
784 | } |
|
785 | ||
786 | /** |
|
787 | * createNewCart |
@@ 477-499 (lines=23) @@ | ||
474 | return $mapping; |
|
475 | } |
|
476 | ||
477 | private function getCartMetadata() |
|
478 | { |
|
479 | $cartMetadata = new ClassMetadata( |
|
480 | 'carts', |
|
481 | 'Mapado\RestClientSdk\Tests\Model\JsonLd\Cart', |
|
482 | '' |
|
483 | ); |
|
484 | ||
485 | $cartMetadata->setAttributeList([ |
|
486 | new Attribute('@id', 'id', 'string', true), |
|
487 | new Attribute('status'), |
|
488 | new Attribute('clientPhoneNumber', 'clientPhoneNumber', 'phone_number'), |
|
489 | new Attribute('createdAt', 'createdAt', 'datetime'), |
|
490 | new Attribute('cart_items', 'cartItemList'), |
|
491 | new Attribute('order'), |
|
492 | ]); |
|
493 | ||
494 | $cartMetadata->setRelationList([ |
|
495 | new Relation('cartItemList', Relation::ONE_TO_MANY, 'Mapado\RestClientSdk\Tests\Model\JsonLd\CartItem'), |
|
496 | ]); |
|
497 | ||
498 | return $cartMetadata; |
|
499 | } |
|
500 | ||
501 | private function getCartItemMetadata() |
|
502 | { |