<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for BinSearchRowBasic StructType
 * @subpackage Structs
 */
class BinSearchRowBasic extends SearchRowBasic
{
    /**
     * The binNumber
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $binNumber;
    /**
     * The externalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $externalId;
    /**
     * The inactive
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnBooleanField[]
     */
    public $inactive;
    /**
     * The internalId
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $internalId;
    /**
     * The location
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $location;
    /**
     * The memo
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $memo;
    /**
     * The customFieldList
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\SearchColumnCustomFieldList
     */
    public $customFieldList;
    /**
     * Constructor method for BinSearchRowBasic
     * @uses BinSearchRowBasic::setBinNumber()
     * @uses BinSearchRowBasic::setExternalId()
     * @uses BinSearchRowBasic::setInactive()
     * @uses BinSearchRowBasic::setInternalId()
     * @uses BinSearchRowBasic::setLocation()
     * @uses BinSearchRowBasic::setMemo()
     * @uses BinSearchRowBasic::setCustomFieldList()
     * @param \StructType\SearchColumnStringField[] $binNumber
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @param \StructType\SearchColumnBooleanField[] $inactive
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @param \StructType\SearchColumnStringField[] $location
     * @param \StructType\SearchColumnStringField[] $memo
     * @param \StructType\SearchColumnCustomFieldList $customFieldList
     */
    public function __construct(array $binNumber = array(), array $externalId = array(), array $inactive = array(), array $internalId = array(), array $location = array(), array $memo = array(), \StructType\SearchColumnCustomFieldList $customFieldList = null)
    {
        $this
            ->setBinNumber($binNumber)
            ->setExternalId($externalId)
            ->setInactive($inactive)
            ->setInternalId($internalId)
            ->setLocation($location)
            ->setMemo($memo)
            ->setCustomFieldList($customFieldList);
    }
    /**
     * Get binNumber value
     * @return \StructType\SearchColumnStringField[]|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 $binSearchRowBasicBinNumberItem) {
            // validation for constraint: itemType
            if (!$binSearchRowBasicBinNumberItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($binSearchRowBasicBinNumberItem) ? get_class($binSearchRowBasicBinNumberItem) : sprintf('%s(%s)', gettype($binSearchRowBasicBinNumberItem), var_export($binSearchRowBasicBinNumberItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The binNumber property can only contain items of type \StructType\SearchColumnStringField, %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\SearchColumnStringField[] $binNumber
     * @return \StructType\BinSearchRowBasic
     */
    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\SearchColumnStringField $item
     * @return \StructType\BinSearchRowBasic
     */
    public function addToBinNumber(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The binNumber property can only contain items of type \StructType\SearchColumnStringField, %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 $binSearchRowBasicExternalIdItem) {
            // validation for constraint: itemType
            if (!$binSearchRowBasicExternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($binSearchRowBasicExternalIdItem) ? get_class($binSearchRowBasicExternalIdItem) : sprintf('%s(%s)', gettype($binSearchRowBasicExternalIdItem), var_export($binSearchRowBasicExternalIdItem, 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\BinSearchRowBasic
     */
    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\BinSearchRowBasic
     */
    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 inactive value
     * @return \StructType\SearchColumnBooleanField[]|null
     */
    public function getInactive()
    {
        return $this->inactive;
    }
    /**
     * This method is responsible for validating the values passed to the setInactive method
     * This method is willingly generated in order to preserve the one-line inline validation within the setInactive method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateInactiveForArrayConstraintsFromSetInactive(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $binSearchRowBasicInactiveItem) {
            // validation for constraint: itemType
            if (!$binSearchRowBasicInactiveItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($binSearchRowBasicInactiveItem) ? get_class($binSearchRowBasicInactiveItem) : sprintf('%s(%s)', gettype($binSearchRowBasicInactiveItem), var_export($binSearchRowBasicInactiveItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The inactive property can only contain items of type \StructType\SearchColumnBooleanField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set inactive value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField[] $inactive
     * @return \StructType\BinSearchRowBasic
     */
    public function setInactive(array $inactive = array())
    {
        // validation for constraint: array
        if ('' !== ($inactiveArrayErrorMessage = self::validateInactiveForArrayConstraintsFromSetInactive($inactive))) {
            throw new \InvalidArgumentException($inactiveArrayErrorMessage, __LINE__);
        }
        $this->inactive = $inactive;
        return $this;
    }
    /**
     * Add item to inactive value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField $item
     * @return \StructType\BinSearchRowBasic
     */
    public function addToInactive(\StructType\SearchColumnBooleanField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnBooleanField) {
            throw new \InvalidArgumentException(sprintf('The inactive property can only contain items of type \StructType\SearchColumnBooleanField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->inactive[] = $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 $binSearchRowBasicInternalIdItem) {
            // validation for constraint: itemType
            if (!$binSearchRowBasicInternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($binSearchRowBasicInternalIdItem) ? get_class($binSearchRowBasicInternalIdItem) : sprintf('%s(%s)', gettype($binSearchRowBasicInternalIdItem), var_export($binSearchRowBasicInternalIdItem, 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\BinSearchRowBasic
     */
    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\BinSearchRowBasic
     */
    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 location value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getLocation()
    {
        return $this->location;
    }
    /**
     * This method is responsible for validating the values passed to the setLocation method
     * This method is willingly generated in order to preserve the one-line inline validation within the setLocation method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateLocationForArrayConstraintsFromSetLocation(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $binSearchRowBasicLocationItem) {
            // validation for constraint: itemType
            if (!$binSearchRowBasicLocationItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($binSearchRowBasicLocationItem) ? get_class($binSearchRowBasicLocationItem) : sprintf('%s(%s)', gettype($binSearchRowBasicLocationItem), var_export($binSearchRowBasicLocationItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The location property can only contain items of type \StructType\SearchColumnStringField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set location value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $location
     * @return \StructType\BinSearchRowBasic
     */
    public function setLocation(array $location = array())
    {
        // validation for constraint: array
        if ('' !== ($locationArrayErrorMessage = self::validateLocationForArrayConstraintsFromSetLocation($location))) {
            throw new \InvalidArgumentException($locationArrayErrorMessage, __LINE__);
        }
        $this->location = $location;
        return $this;
    }
    /**
     * Add item to location value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\BinSearchRowBasic
     */
    public function addToLocation(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The location property can only contain items of type \StructType\SearchColumnStringField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->location[] = $item;
        return $this;
    }
    /**
     * Get memo value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getMemo()
    {
        return $this->memo;
    }
    /**
     * This method is responsible for validating the values passed to the setMemo method
     * This method is willingly generated in order to preserve the one-line inline validation within the setMemo method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateMemoForArrayConstraintsFromSetMemo(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $binSearchRowBasicMemoItem) {
            // validation for constraint: itemType
            if (!$binSearchRowBasicMemoItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($binSearchRowBasicMemoItem) ? get_class($binSearchRowBasicMemoItem) : sprintf('%s(%s)', gettype($binSearchRowBasicMemoItem), var_export($binSearchRowBasicMemoItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The memo property can only contain items of type \StructType\SearchColumnStringField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set memo value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $memo
     * @return \StructType\BinSearchRowBasic
     */
    public function setMemo(array $memo = array())
    {
        // validation for constraint: array
        if ('' !== ($memoArrayErrorMessage = self::validateMemoForArrayConstraintsFromSetMemo($memo))) {
            throw new \InvalidArgumentException($memoArrayErrorMessage, __LINE__);
        }
        $this->memo = $memo;
        return $this;
    }
    /**
     * Add item to memo value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\BinSearchRowBasic
     */
    public function addToMemo(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The memo property can only contain items of type \StructType\SearchColumnStringField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->memo[] = $item;
        return $this;
    }
    /**
     * Get customFieldList value
     * @return \StructType\SearchColumnCustomFieldList|null
     */
    public function getCustomFieldList()
    {
        return $this->customFieldList;
    }
    /**
     * Set customFieldList value
     * @param \StructType\SearchColumnCustomFieldList $customFieldList
     * @return \StructType\BinSearchRowBasic
     */
    public function setCustomFieldList(\StructType\SearchColumnCustomFieldList $customFieldList = null)
    {
        $this->customFieldList = $customFieldList;
        return $this;
    }
}
