Skip to content
Browse files

add PricingSet to entities

  • Loading branch information...
1 parent c414c06 commit a88d663573c42080b894567f9b1f59c28538dc8b @iampersistent iampersistent committed
Showing with 69 additions and 0 deletions.
  1. +51 −0 lib/Vespolina/Entity/Pricing/PricingSet.php
  2. +18 −0 lib/Vespolina/Entity/Pricing/PricingSetInterface.php
View
51 lib/Vespolina/Entity/Pricing/PricingSet.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * (c) 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\Pricing;
+
+use Vespolina\Pricing\PricingSetInterface;
+
+class PricingSet implements PricingSetInterface
+{
+ protected $pricingElements;
+
+ public function __construct()
+ {
+ $this->pricingElements = array();
+ }
+
+ public function __get($name)
+ {
+ return $this->get($name);
+ }
+
+ public function get($name)
+ {
+ if (array_key_exists($name, $this->pricingElements)) {
+ return $this->pricingElements[$name];
+ }
+ }
+
+ public function set($name, $value)
+ {
+ $this->pricingElements[$name] = $value;
+ }
+
+ public function setAll($pricingElements)
+ {
+ $this->pricingElements = $pricingElements;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function all()
+ {
+ return $this->pricingElements;
+ }
+}
View
18 lib/Vespolina/Entity/Pricing/PricingSetInterface.php
@@ -0,0 +1,18 @@
+<?php
+/**
+ * (c) 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\Pricing;
+
+interface PricingSetInterface
+{
+
+ function all();
+ function get($name);
+ function set($name, $value);
+
+}

0 comments on commit a88d663

Please sign in to comment.
Something went wrong with that request. Please try again.