Permalink
Browse files

add Merchandise

  • Loading branch information...
1 parent b9f97a4 commit 824c9ecdf57ff0afaa2cbed7c74abdefa6c7b4de @iampersistent iampersistent committed Sep 2, 2012
View
7 lib/Vespolina/Entity/Product/BaseProductInterface.php
@@ -46,13 +46,6 @@ function clearFeatures();
function getFeatures();
/**
- * Remove a feature by its type
- *
- * @param $type
- */
- function removeFeature($type);
-
- /**
* Set the features of the product to a feature set
*
* @param $features
View
114 lib/Vespolina/Entity/Product/Merchandise.php
@@ -0,0 +1,114 @@
+<?php
+/**
+ * (c) 2012 Vespolina Project http://www.vespolina-project.org
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace Vespolina\Entity\Product;
+
+use Vespolina\Entity\Pricing\PricingSet;
+use Vespolina\Entity\Product\BaseProduct;
+use Vespolina\Entity\Product\MerchandiseInterface;
+
+class Merchandise extends BaseProduct implements MerchandiseInterface
+{
+ protected $activateOn;
+ protected $active;
+ protected $assets;
+ protected $deactivateOn;
+ protected $pricing;
+ protected $product;
+ protected $slug;
+ protected $store;
+ protected $terms;
+
+ /**
+ * @inheritdoc
+ */
+ public function setActivateOn(\DateTime $activateOn)
+ {
+ $this->activateOn = $activateOn;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getActivateOn()
+ {
+ return $this->activateOn;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function setActive($active)
+ {
+ $this->active = $active;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getActive()
+ {
+ return $this->active;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function setDeactivateOn(\DateTime $deactivateOn)
+ {
+ $this->deactivateOn = $deactivateOn;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getDeactivateOn()
+ {
+ return $this->deactivateOn;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function setPricing(PricingSet $pricing)
+ {
+ $this->pricing = $pricing;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getPricing()
+ {
+ return $this->pricing;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getProduct()
+ {
+ return $this->product;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function setStore($store)
+ {
+ $this->store = $store;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function getStore()
+ {
+ return $this->store;
+ }
+}
View
98 lib/Vespolina/Entity/Product/MerchandiseInterface.php
@@ -0,0 +1,98 @@
+<?php
+/**
+ * (c) 2012 Vespolina Project http://www.vespolina-project.org
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace Vespolina\Entity\Product;
+
+use Vespolina\Entity\Pricing\PricingSet;
+use Vespolina\Entity\Product\BaseProductInterface;
+
+interface MerchandiseInterface extends BaseProductInterface
+{
+ /**
+ * Set the date this merchandise becomes active in the store.
+ *
+ * @param \DateTime $activateOn
+ */
+ function setActivateOn(\DateTime $activateOn);
+
+ /**
+ * Return the date when this merchandise becomes active in the store.
+ *
+ * @return \DateTime
+ */
+ function getActivateOn();
+
+ /**
+ * Set the merchandise to an active state in the store.
+ *
+ * When active is set to true, if the current time is not in the activate/deactivate time
+ * range or the activateOn property is null, the activateOn will be set to the current time.
+ *
+ * When active is set to false, the deactivateOn will be set to the current time.
+ *
+ * @param boolean $active
+ */
+ function setActive($active);
+
+ /**
+ * Return if this merchandise is active. If the active property is not set, the activateOn/deactivateOn
+ * time range is used to determine if its active.
+ *
+ * @return boolean
+ */
+ function getActive();
+
+ /**
+ * Set the date this merchandise becomes inactive in the store.
+ *
+ * @param \DateTime $deactivateOn
+ */
+ function setDeactivateOn(\DateTime $deactivateOn);
+
+ /**
+ * Return the date when this merchandise is no longer active in the store.
+ *
+ * @return \DateTime
+ */
+ function getDeactivateOn();
+
+ /**
+ * Return the PricingSet for this merchandise
+ *
+ * @param \Vespolina\Entity\Pricing\PricingSet $pricingSet
+ */
+ function setPricing(PricingSet $pricingSet);
+
+ /**
+ * Return the PricingSet for this merchandise
+ *
+ * @return \Vespolina\Entity\Pricing\PricingSet $pricingSet
+ */
+ function getPricing();
+
+ /**
+ * Return the product of this merchandise
+ *
+ * @return \Vespolina\Entity\Product\ProductInterface
+ */
+ function getProduct();
+
+ /**
+ * Set the store this merchandise belongs in
+ *
+ * @param $store
+ */
+ function setStore($store);
+
+ /**
+ * Return the store this merchandise belongs in
+ *
+ * @return
+ */
+ function getStore();
+}

0 comments on commit 824c9ec

Please sign in to comment.