Source of file InsertArticleParameter.php

Size: 5,287 Bytes - Last Modified: 2015-02-05T12:57:19+01:00

/www-data/git/ricardo/src/Diglin/Ricardo/Managers/Sell/Parameter/InsertArticleParameter.php

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
<?php
/**
 * Diglin GmbH - Switzerland
 *
 * This file is part of a Diglin GmbH module.
 *
 * This Diglin GmbH module is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * This script is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * @author      Sylvain Rayé <support at diglin.com>
 * @category    Diglin
 * @package     Diglin_Ricardo
 * @copyright   Copyright (c) 2011-2015 Diglin (http://www.diglin.com)
 * @license     http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
 */
namespace Diglin\Ricardo\Managers\Sell\Parameter;

use Diglin\Ricardo\Managers\ParameterAbstract;

/**
 * Class InsertArticleParameter
 * @package Diglin\Ricardo\Managers\Sell
 */
class InsertArticleParameter extends ParameterAbstract
{
    /**
     * @var string
     */
    protected $_antiforgeryToken; // required

    /**
     * @var ArticleInformationParameter
     */
    protected $_articleInformation; // required

    /**
     * @var array
     */
    protected $_descriptions = array(); // required

    /**
     * @var null
     */
    protected $_brandingArticleDetails = null; // optional

    /**
     * @var int
     */
    protected $_carDealerArticleId; // optional

    /**
     * @var boolean
     */
    protected $_isUpdateArticle; // Set to true if the preview is created for an update of live article without bid

    /**
     * @var array
     */
    protected $_pictures = array(); // required

    protected $_requiredProperties = array(
        'antiforgeryToken',
        'articleInformation',
        'descriptions',
        'pictures',
    );

    protected $_optionalProperties = array(
        'brandingArticleDetails',
        'isUpdateArticle',
        'carDealerArticleId'
    );

    /**
     * @param string $antiforgeryToken
     * @return $this
     */
    public function setAntiforgeryToken($antiforgeryToken)
    {
        $this->_antiforgeryToken = $antiforgeryToken;
        return $this;
    }

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

    /**
     * @param \Diglin\Ricardo\Managers\Sell\Parameter\ArticleInformationParameter $articleInformation
     * @return $this
     */
    public function setArticleInformation(ArticleInformationParameter $articleInformation)
    {
        $this->_articleInformation = $articleInformation;
        return $this;
    }

    /**
     * @return \Diglin\Ricardo\Managers\Sell\Parameter\ArticleInformationParameter
     */
    public function getArticleInformation()
    {
        return $this->_articleInformation;
    }

    /**
     * @param null $brandingArticleDetails
     * @return $this
     */
    public function setBrandingArticleDetails($brandingArticleDetails)
    {
        $this->_brandingArticleDetails = $brandingArticleDetails;
        return $this;
    }

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

    /**
     * @param int $carDealerArticleId
     * @return $this
     */
    public function setCarDealerArticleId($carDealerArticleId)
    {
        $this->_carDealerArticleId = $carDealerArticleId;
        return $this;
    }

    /**
     * @return int
     */
    public function getCarDealerArticleId()
    {
        return $this->_carDealerArticleId;
    }

    /**
     * @param \Diglin\Ricardo\Managers\Sell\Parameter\ArticleDescriptionParameter $descriptions
     * @param bool $clear
     * @return $this
     */
    public function setDescriptions(ArticleDescriptionParameter $descriptions, $clear = false)
    {
        if ($clear) {
            $this->_descriptions = array();
        }

        $this->_descriptions[] = $descriptions;
        return $this;
    }

    /**
     * @return array of \Diglin\Ricardo\Managers\Sell\Parameter\ArticleDescriptionParameter
     */
    public function getDescriptions()
    {
        return $this->_descriptions;
    }

    /**
     * @param boolean $isUpdateArticle
     * @return $this
     */
    public function setIsUpdateArticle($isUpdateArticle)
    {
        $this->_isUpdateArticle = $isUpdateArticle;
        return $this;
    }

    /**
     * @return boolean
     */
    public function getIsUpdateArticle()
    {
        return $this->_isUpdateArticle;
    }

    /**
     * @param \Diglin\Ricardo\Managers\Sell\Parameter\ArticlePictureParameter $pictures
     * @param bool $clear
     * @return $this
     */
    public function setPictures(ArticlePictureParameter $pictures = null, $clear = false)
    {
        if ($clear) {
            $this->_pictures = array();
        }

        if (is_null($pictures)) {
            return $this;
        }

        $this->_pictures[] = $pictures;
        return $this;
    }

    /**
     * @return array of \Diglin\Ricardo\Managers\Sell\Parameter\ArticlePictureParameter
     */
    public function getPictures()
    {
        return $this->_pictures;
    }
}