X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Form%2Ftests%2FDoctrine%2FTests%2FModels%2FECommerce%2FECommerceCart.php;fp=vendor%2Fdoctrine%2Form%2Ftests%2FDoctrine%2FTests%2FModels%2FECommerce%2FECommerceCart.php;h=3d9f6798f1cbccefe4a9ee3880d2c564d9a91a1b;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fapplication_blanche.git diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php new file mode 100644 index 0000000..3d9f679 --- /dev/null +++ b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php @@ -0,0 +1,91 @@ +products = new ArrayCollection; + } + + public function getId() { + return $this->id; + } + + public function getPayment() { + return $this->payment; + } + + public function setPayment($payment) { + $this->payment = $payment; + } + + public function setCustomer(ECommerceCustomer $customer) { + if ($this->customer !== $customer) { + $this->customer = $customer; + $customer->setCart($this); + } + } + + public function removeCustomer() { + if ($this->customer !== null) { + $customer = $this->customer; + $this->customer = null; + $customer->removeCart(); + } + } + + public function getCustomer() { + return $this->customer; + } + + public function getProducts() + { + return $this->products; + } + + public function addProduct(ECommerceProduct $product) { + $this->products[] = $product; + } + + public function removeProduct(ECommerceProduct $product) { + return $this->products->removeElement($product); + } +}