MyException - 我的异常网
当前位置:我的异常网» PHP » 请大家帮忙看看有关问题

请大家帮忙看看有关问题(2)

www.myexceptions.net  网友分享于:2013-04-10  浏览:15次

        $this->currency = $fields['currency'];
        $this->price = $fields['price'];
    }

    public function getCurrency()
    {
        return $this->currency;
    }

    public function getManufacturer()
    {
        return $this->manufacturer;
    }

    public function getPrice()
    {
        return $this->price;
    }

    public function getTitle()
    {
        return $this->title;
    }
}


Product.php

<?php
include_once 'BaseItem.php';

class Product extends BaseItem
{
    protected $productName;
    protected $manufacturer;
    protected $family;
    protected $model;
    protected $announcedDate;

    /**
     * @inheritDoc
     */
    public function buildFromArray(array $fields)
    {
        $this->productName = $fields['product_name'];
        $this->manufacturer = $fields['manufacturer'];
        $this->family = isset($fields['family']) ? $fields['family'] : null;
        $this->model = $fields['model'];
        $this->announcedDate = $fields['announced-date'];
    }

    /**
     * @inheritDoc
     */
    public function convertToArray()
    {
        return array(
            'product_name' => $this->productName,
            'manufacturer' => $this->manufacturer,
            'family' => $this->family,
            'model' => $this->model,
            'announced-date' => $this->announcedDate,
        );
    }

    public function getAnnouncedDate()
    {
        return $this->announcedDate;
    }

    public function getFamily()
    {
        return $this->family;
    }

    public function getManufacturer()

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有