]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/class_Merchant.php
More style convensions applied, interface updated
[shipsimu.git] / application / ship-simu / main / class_Merchant.php
index 3a2b892bd816576e1de3fc48215a9a2007493efc..24d21b6a093b9f24dd27f3c78d64b186ecacc535 100644 (file)
@@ -19,7 +19,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class Merchant extends BaseFrameworkSystem {
        // Name des Haendlers
@@ -32,20 +32,12 @@ class Merchant extends BaseFrameworkSystem {
        private $harborInstance = null;
 
        // Konstruktor
-       private function __construct () {
+       protected function __construct () {
                // Call parent constructor
-               parent::constructor(__CLASS__);
-
-               // Debug message
-               if (((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) {
-                       $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
-                               __CLASS__,
-                               __LINE__
-                       ));
-               }
+               parent::__construct(__CLASS__);
 
                // Set description
-               $this->setPartDescr("H&auml;ndler");
+               $this->setObjectDescription("H&auml;ndler");
 
                // Generate unique ID number
                $this->createUniqueID();
@@ -142,7 +134,7 @@ class Merchant extends BaseFrameworkSystem {
        }
 
        // Add new item to merchant's price list
-       public function addItemToPriceList (ItemIsTradeable $itemInstance, $price) {
+       public function addItemToPriceList (TradeableItem $itemInstance, $price) {
                // Secure pricing
                $price = (float) $price;
 
@@ -152,7 +144,7 @@ class Merchant extends BaseFrameworkSystem {
                        __LINE__,
                        $this->getMerchantName(),
                        $itemInstance->__toString(),
-                       $itemInstance->getPartDescr(),
+                       $itemInstance->getObjectDescription(),
                        $this->formatCurrency($price)
                ));
 
@@ -167,7 +159,7 @@ class Merchant extends BaseFrameworkSystem {
        }
 
        // Get a price from the merchant's list
-       public final function getPriceFromList (ItemIsTradeable $itemInstance) {
+       public final function getPriceFromList (TradeableItem $itemInstance) {
                $price = 0;
 
                // Iterate throw whole list
@@ -192,16 +184,6 @@ class Merchant extends BaseFrameworkSystem {
                // Return price
                return $price;
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
 }
 
 // [EOF]