<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for InventoryDetailSearchRowBasic StructType
 * @subpackage Structs
 */
class InventoryDetailSearchRowBasic extends SearchRowBasic
{
    /**
     * The binNumber
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $binNumber;
    /**
     * The externalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $externalId;
    /**
     * The internalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $internalId;
    /**
     * The inventoryNumber
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $inventoryNumber;
    /**
     * The quantity
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnDoubleField[]
     */
    public $quantity;
    /**
     * The status
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $status;
    /**
     * Constructor method for InventoryDetailSearchRowBasic
     * @uses InventoryDetailSearchRowBasic::setBinNumber()
     * @uses InventoryDetailSearchRowBasic::setExternalId()
     * @uses InventoryDetailSearchRowBasic::setInternalId()
     * @uses InventoryDetailSearchRowBasic::setInventoryNumber()
     * @uses InventoryDetailSearchRowBasic::setQuantity()
     * @uses InventoryDetailSearchRowBasic::setStatus()
     * @param \StructType\SearchColumnSelectField[] $binNumber
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @param \StructType\SearchColumnSelectField[] $inventoryNumber
     * @param \StructType\SearchColumnDoubleField[] $quantity
     * @param \StructType\SearchColumnSelectField[] $status
     */
    public function __construct(array $binNumber = array(), array $externalId = array(), array $internalId = array(), array $inventoryNumber = array(), array $quantity = array(), array $status = array())
    {
        $this
            ->setBinNumber($binNumber)
            ->setExternalId($externalId)
            ->setInternalId($internalId)
            ->setInventoryNumber($inventoryNumber)
            ->setQuantity($quantity)
            ->setStatus($status);
    }
    /**
     * Get binNumber value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getBinNumber()
    {
        return $this->binNumber;
    }
    /**
     * This method is responsible for validating the values passed to the setBinNumber method
     * This method is willingly generated in order to preserve the one-line inline validation within the setBinNumber method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateBinNumberForArrayConstraintsFromSetBinNumber(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $inventoryDetailSearchRowBasicBinNumberItem) {
            // validation for constraint: itemType
            if (!$inventoryDetailSearchRowBasicBinNumberItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($inventoryDetailSearchRowBasicBinNumberItem) ? get_class($inventoryDetailSearchRowBasicBinNumberItem) : sprintf('%s(%s)', gettype($inventoryDetailSearchRowBasicBinNumberItem), var_export($inventoryDetailSearchRowBasicBinNumberItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The binNumber property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set binNumber value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $binNumber
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function setBinNumber(array $binNumber = array())
    {
        // validation for constraint: array
        if ('' !== ($binNumberArrayErrorMessage = self::validateBinNumberForArrayConstraintsFromSetBinNumber($binNumber))) {
            throw new \InvalidArgumentException($binNumberArrayErrorMessage, __LINE__);
        }
        $this->binNumber = $binNumber;
        return $this;
    }
    /**
     * Add item to binNumber value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function addToBinNumber(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The binNumber property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->binNumber[] = $item;
        return $this;
    }
    /**
     * Get externalId value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getExternalId()
    {
        return $this->externalId;
    }
    /**
     * This method is responsible for validating the values passed to the setExternalId method
     * This method is willingly generated in order to preserve the one-line inline validation within the setExternalId method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateExternalIdForArrayConstraintsFromSetExternalId(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $inventoryDetailSearchRowBasicExternalIdItem) {
            // validation for constraint: itemType
            if (!$inventoryDetailSearchRowBasicExternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($inventoryDetailSearchRowBasicExternalIdItem) ? get_class($inventoryDetailSearchRowBasicExternalIdItem) : sprintf('%s(%s)', gettype($inventoryDetailSearchRowBasicExternalIdItem), var_export($inventoryDetailSearchRowBasicExternalIdItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The externalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set externalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function setExternalId(array $externalId = array())
    {
        // validation for constraint: array
        if ('' !== ($externalIdArrayErrorMessage = self::validateExternalIdForArrayConstraintsFromSetExternalId($externalId))) {
            throw new \InvalidArgumentException($externalIdArrayErrorMessage, __LINE__);
        }
        $this->externalId = $externalId;
        return $this;
    }
    /**
     * Add item to externalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function addToExternalId(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The externalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->externalId[] = $item;
        return $this;
    }
    /**
     * Get internalId value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getInternalId()
    {
        return $this->internalId;
    }
    /**
     * This method is responsible for validating the values passed to the setInternalId method
     * This method is willingly generated in order to preserve the one-line inline validation within the setInternalId method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateInternalIdForArrayConstraintsFromSetInternalId(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $inventoryDetailSearchRowBasicInternalIdItem) {
            // validation for constraint: itemType
            if (!$inventoryDetailSearchRowBasicInternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($inventoryDetailSearchRowBasicInternalIdItem) ? get_class($inventoryDetailSearchRowBasicInternalIdItem) : sprintf('%s(%s)', gettype($inventoryDetailSearchRowBasicInternalIdItem), var_export($inventoryDetailSearchRowBasicInternalIdItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The internalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set internalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function setInternalId(array $internalId = array())
    {
        // validation for constraint: array
        if ('' !== ($internalIdArrayErrorMessage = self::validateInternalIdForArrayConstraintsFromSetInternalId($internalId))) {
            throw new \InvalidArgumentException($internalIdArrayErrorMessage, __LINE__);
        }
        $this->internalId = $internalId;
        return $this;
    }
    /**
     * Add item to internalId value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function addToInternalId(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The internalId property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->internalId[] = $item;
        return $this;
    }
    /**
     * Get inventoryNumber value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getInventoryNumber()
    {
        return $this->inventoryNumber;
    }
    /**
     * This method is responsible for validating the values passed to the setInventoryNumber method
     * This method is willingly generated in order to preserve the one-line inline validation within the setInventoryNumber method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateInventoryNumberForArrayConstraintsFromSetInventoryNumber(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $inventoryDetailSearchRowBasicInventoryNumberItem) {
            // validation for constraint: itemType
            if (!$inventoryDetailSearchRowBasicInventoryNumberItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($inventoryDetailSearchRowBasicInventoryNumberItem) ? get_class($inventoryDetailSearchRowBasicInventoryNumberItem) : sprintf('%s(%s)', gettype($inventoryDetailSearchRowBasicInventoryNumberItem), var_export($inventoryDetailSearchRowBasicInventoryNumberItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The inventoryNumber property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set inventoryNumber value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $inventoryNumber
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function setInventoryNumber(array $inventoryNumber = array())
    {
        // validation for constraint: array
        if ('' !== ($inventoryNumberArrayErrorMessage = self::validateInventoryNumberForArrayConstraintsFromSetInventoryNumber($inventoryNumber))) {
            throw new \InvalidArgumentException($inventoryNumberArrayErrorMessage, __LINE__);
        }
        $this->inventoryNumber = $inventoryNumber;
        return $this;
    }
    /**
     * Add item to inventoryNumber value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function addToInventoryNumber(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The inventoryNumber property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->inventoryNumber[] = $item;
        return $this;
    }
    /**
     * Get quantity value
     * @return \StructType\SearchColumnDoubleField[]|null
     */
    public function getQuantity()
    {
        return $this->quantity;
    }
    /**
     * This method is responsible for validating the values passed to the setQuantity method
     * This method is willingly generated in order to preserve the one-line inline validation within the setQuantity method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateQuantityForArrayConstraintsFromSetQuantity(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $inventoryDetailSearchRowBasicQuantityItem) {
            // validation for constraint: itemType
            if (!$inventoryDetailSearchRowBasicQuantityItem instanceof \StructType\SearchColumnDoubleField) {
                $invalidValues[] = is_object($inventoryDetailSearchRowBasicQuantityItem) ? get_class($inventoryDetailSearchRowBasicQuantityItem) : sprintf('%s(%s)', gettype($inventoryDetailSearchRowBasicQuantityItem), var_export($inventoryDetailSearchRowBasicQuantityItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The quantity property can only contain items of type \StructType\SearchColumnDoubleField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set quantity value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDoubleField[] $quantity
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function setQuantity(array $quantity = array())
    {
        // validation for constraint: array
        if ('' !== ($quantityArrayErrorMessage = self::validateQuantityForArrayConstraintsFromSetQuantity($quantity))) {
            throw new \InvalidArgumentException($quantityArrayErrorMessage, __LINE__);
        }
        $this->quantity = $quantity;
        return $this;
    }
    /**
     * Add item to quantity value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDoubleField $item
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function addToQuantity(\StructType\SearchColumnDoubleField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnDoubleField) {
            throw new \InvalidArgumentException(sprintf('The quantity property can only contain items of type \StructType\SearchColumnDoubleField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->quantity[] = $item;
        return $this;
    }
    /**
     * Get status value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getStatus()
    {
        return $this->status;
    }
    /**
     * This method is responsible for validating the values passed to the setStatus method
     * This method is willingly generated in order to preserve the one-line inline validation within the setStatus method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateStatusForArrayConstraintsFromSetStatus(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $inventoryDetailSearchRowBasicStatusItem) {
            // validation for constraint: itemType
            if (!$inventoryDetailSearchRowBasicStatusItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($inventoryDetailSearchRowBasicStatusItem) ? get_class($inventoryDetailSearchRowBasicStatusItem) : sprintf('%s(%s)', gettype($inventoryDetailSearchRowBasicStatusItem), var_export($inventoryDetailSearchRowBasicStatusItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The status property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set status value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $status
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function setStatus(array $status = array())
    {
        // validation for constraint: array
        if ('' !== ($statusArrayErrorMessage = self::validateStatusForArrayConstraintsFromSetStatus($status))) {
            throw new \InvalidArgumentException($statusArrayErrorMessage, __LINE__);
        }
        $this->status = $status;
        return $this;
    }
    /**
     * Add item to status value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\InventoryDetailSearchRowBasic
     */
    public function addToStatus(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The status property can only contain items of type \StructType\SearchColumnSelectField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->status[] = $item;
        return $this;
    }
}
