<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ItemPrintingMethods StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:ItemPrintingMethods
 * @subpackage Structs
 */
class ItemPrintingMethods extends AbstractStructBase
{
    /**
     * The InEsroWebAppOfferSendToAnyOwner
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $InEsroWebAppOfferSendToAnyOwner;
    /**
     * The InEsroWebAppTargetIsMandatory
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $InEsroWebAppTargetIsMandatory;
    /**
     * The ItemId
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var int
     */
    public $ItemId;
    /**
     * The PrintingMethods
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfPrinting_PrintingMethod
     */
    public $PrintingMethods;
    /**
     * Constructor method for ItemPrintingMethods
     * @uses ItemPrintingMethods::setInEsroWebAppOfferSendToAnyOwner()
     * @uses ItemPrintingMethods::setInEsroWebAppTargetIsMandatory()
     * @uses ItemPrintingMethods::setItemId()
     * @uses ItemPrintingMethods::setPrintingMethods()
     * @param bool $inEsroWebAppOfferSendToAnyOwner
     * @param bool $inEsroWebAppTargetIsMandatory
     * @param int $itemId
     * @param \patest\ArrayType\ArrayOfPrinting_PrintingMethod $printingMethods
     */
    public function __construct($inEsroWebAppOfferSendToAnyOwner = null, $inEsroWebAppTargetIsMandatory = null, $itemId = null, \patest\ArrayType\ArrayOfPrinting_PrintingMethod $printingMethods = null)
    {
        $this
            ->setInEsroWebAppOfferSendToAnyOwner($inEsroWebAppOfferSendToAnyOwner)
            ->setInEsroWebAppTargetIsMandatory($inEsroWebAppTargetIsMandatory)
            ->setItemId($itemId)
            ->setPrintingMethods($printingMethods);
    }
    /**
     * Get InEsroWebAppOfferSendToAnyOwner value
     * @return bool|null
     */
    public function getInEsroWebAppOfferSendToAnyOwner()
    {
        return $this->InEsroWebAppOfferSendToAnyOwner;
    }
    /**
     * Set InEsroWebAppOfferSendToAnyOwner value
     * @param bool $inEsroWebAppOfferSendToAnyOwner
     * @return \patest\StructType\ItemPrintingMethods
     */
    public function setInEsroWebAppOfferSendToAnyOwner($inEsroWebAppOfferSendToAnyOwner = null)
    {
        // validation for constraint: boolean
        if (!is_null($inEsroWebAppOfferSendToAnyOwner) && !is_bool($inEsroWebAppOfferSendToAnyOwner)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($inEsroWebAppOfferSendToAnyOwner, true), gettype($inEsroWebAppOfferSendToAnyOwner)), __LINE__);
        }
        $this->InEsroWebAppOfferSendToAnyOwner = $inEsroWebAppOfferSendToAnyOwner;
        return $this;
    }
    /**
     * Get InEsroWebAppTargetIsMandatory value
     * @return bool|null
     */
    public function getInEsroWebAppTargetIsMandatory()
    {
        return $this->InEsroWebAppTargetIsMandatory;
    }
    /**
     * Set InEsroWebAppTargetIsMandatory value
     * @param bool $inEsroWebAppTargetIsMandatory
     * @return \patest\StructType\ItemPrintingMethods
     */
    public function setInEsroWebAppTargetIsMandatory($inEsroWebAppTargetIsMandatory = null)
    {
        // validation for constraint: boolean
        if (!is_null($inEsroWebAppTargetIsMandatory) && !is_bool($inEsroWebAppTargetIsMandatory)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($inEsroWebAppTargetIsMandatory, true), gettype($inEsroWebAppTargetIsMandatory)), __LINE__);
        }
        $this->InEsroWebAppTargetIsMandatory = $inEsroWebAppTargetIsMandatory;
        return $this;
    }
    /**
     * Get ItemId value
     * @return int|null
     */
    public function getItemId()
    {
        return $this->ItemId;
    }
    /**
     * Set ItemId value
     * @param int $itemId
     * @return \patest\StructType\ItemPrintingMethods
     */
    public function setItemId($itemId = null)
    {
        // validation for constraint: int
        if (!is_null($itemId) && !(is_int($itemId) || ctype_digit($itemId))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($itemId, true), gettype($itemId)), __LINE__);
        }
        $this->ItemId = $itemId;
        return $this;
    }
    /**
     * Get PrintingMethods value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return \patest\ArrayType\ArrayOfPrinting_PrintingMethod|null
     */
    public function getPrintingMethods()
    {
        return isset($this->PrintingMethods) ? $this->PrintingMethods : null;
    }
    /**
     * Set PrintingMethods value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param \patest\ArrayType\ArrayOfPrinting_PrintingMethod $printingMethods
     * @return \patest\StructType\ItemPrintingMethods
     */
    public function setPrintingMethods(\patest\ArrayType\ArrayOfPrinting_PrintingMethod $printingMethods = null)
    {
        if (is_null($printingMethods) || (is_array($printingMethods) && empty($printingMethods))) {
            unset($this->PrintingMethods);
        } else {
            $this->PrintingMethods = $printingMethods;
        }
        return $this;
    }
}
