<?php
/**
 * Created by PhpStorm.
 * Damian Banaszkiewicz <dbanaszkiewicz@unicorn.net.pl>
 * 22.08.18 11:15
 */

namespace FCA\StockApi\Document\Offer;

use FCA\StockApi\Document\Base;

class Color extends Base
{
    /**
     * @var string
     */
    protected $code;

    /**
     * @var string
     */
    protected $name;

    /**
     * @var string
     */
    protected $category;

    /**
     * @var string
     */
    protected $type;

    /**
     * Color constructor.
     * @param $color
     * @throws \FCA\StockApi\Exception\ApiException
     */
    public function __construct($color)
    {
        $required_keys = ['code', 'name', 'category', 'type'];
        $this->checkKeys($required_keys, $color);

        $this->code = $color['code'];
        $this->name = $color['name'];
        $this->category = $color['category'];
        $this->type = $color['type'];
    }

    /**
     * @return string
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @return null
     */
    public function getCategory()
    {
        return $this->category;
    }

    /**
     * @return null
     */
    public function getType()
    {
        return $this->type;
    }
}
