<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ContactCategorySearchRowBasic StructType
 * @subpackage Structs
 */
class ContactCategorySearchRowBasic extends SearchRowBasic
{
    /**
     * 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 isInactive
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnBooleanField[]
     */
    public $isInactive;
    /**
     * The name
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $name;
    /**
     * The private
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnBooleanField[]
     */
    public $private;
    /**
     * The sync
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnBooleanField[]
     */
    public $sync;
    /**
     * Constructor method for ContactCategorySearchRowBasic
     * @uses ContactCategorySearchRowBasic::setExternalId()
     * @uses ContactCategorySearchRowBasic::setInternalId()
     * @uses ContactCategorySearchRowBasic::setIsInactive()
     * @uses ContactCategorySearchRowBasic::setName()
     * @uses ContactCategorySearchRowBasic::setPrivate()
     * @uses ContactCategorySearchRowBasic::setSync()
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @param \StructType\SearchColumnBooleanField[] $isInactive
     * @param \StructType\SearchColumnStringField[] $name
     * @param \StructType\SearchColumnBooleanField[] $private
     * @param \StructType\SearchColumnBooleanField[] $sync
     */
    public function __construct(array $externalId = array(), array $internalId = array(), array $isInactive = array(), array $name = array(), array $private = array(), array $sync = array())
    {
        $this
            ->setExternalId($externalId)
            ->setInternalId($internalId)
            ->setIsInactive($isInactive)
            ->setName($name)
            ->setPrivate($private)
            ->setSync($sync);
    }
    /**
     * 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 $contactCategorySearchRowBasicExternalIdItem) {
            // validation for constraint: itemType
            if (!$contactCategorySearchRowBasicExternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($contactCategorySearchRowBasicExternalIdItem) ? get_class($contactCategorySearchRowBasicExternalIdItem) : sprintf('%s(%s)', gettype($contactCategorySearchRowBasicExternalIdItem), var_export($contactCategorySearchRowBasicExternalIdItem, 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\ContactCategorySearchRowBasic
     */
    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\ContactCategorySearchRowBasic
     */
    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 $contactCategorySearchRowBasicInternalIdItem) {
            // validation for constraint: itemType
            if (!$contactCategorySearchRowBasicInternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($contactCategorySearchRowBasicInternalIdItem) ? get_class($contactCategorySearchRowBasicInternalIdItem) : sprintf('%s(%s)', gettype($contactCategorySearchRowBasicInternalIdItem), var_export($contactCategorySearchRowBasicInternalIdItem, 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\ContactCategorySearchRowBasic
     */
    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\ContactCategorySearchRowBasic
     */
    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 isInactive value
     * @return \StructType\SearchColumnBooleanField[]|null
     */
    public function getIsInactive()
    {
        return $this->isInactive;
    }
    /**
     * This method is responsible for validating the values passed to the setIsInactive method
     * This method is willingly generated in order to preserve the one-line inline validation within the setIsInactive method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateIsInactiveForArrayConstraintsFromSetIsInactive(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $contactCategorySearchRowBasicIsInactiveItem) {
            // validation for constraint: itemType
            if (!$contactCategorySearchRowBasicIsInactiveItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($contactCategorySearchRowBasicIsInactiveItem) ? get_class($contactCategorySearchRowBasicIsInactiveItem) : sprintf('%s(%s)', gettype($contactCategorySearchRowBasicIsInactiveItem), var_export($contactCategorySearchRowBasicIsInactiveItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The isInactive 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 isInactive value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField[] $isInactive
     * @return \StructType\ContactCategorySearchRowBasic
     */
    public function setIsInactive(array $isInactive = array())
    {
        // validation for constraint: array
        if ('' !== ($isInactiveArrayErrorMessage = self::validateIsInactiveForArrayConstraintsFromSetIsInactive($isInactive))) {
            throw new \InvalidArgumentException($isInactiveArrayErrorMessage, __LINE__);
        }
        $this->isInactive = $isInactive;
        return $this;
    }
    /**
     * Add item to isInactive value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField $item
     * @return \StructType\ContactCategorySearchRowBasic
     */
    public function addToIsInactive(\StructType\SearchColumnBooleanField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnBooleanField) {
            throw new \InvalidArgumentException(sprintf('The isInactive 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->isInactive[] = $item;
        return $this;
    }
    /**
     * Get name value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * This method is responsible for validating the values passed to the setName method
     * This method is willingly generated in order to preserve the one-line inline validation within the setName method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateNameForArrayConstraintsFromSetName(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $contactCategorySearchRowBasicNameItem) {
            // validation for constraint: itemType
            if (!$contactCategorySearchRowBasicNameItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($contactCategorySearchRowBasicNameItem) ? get_class($contactCategorySearchRowBasicNameItem) : sprintf('%s(%s)', gettype($contactCategorySearchRowBasicNameItem), var_export($contactCategorySearchRowBasicNameItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The name 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 name value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $name
     * @return \StructType\ContactCategorySearchRowBasic
     */
    public function setName(array $name = array())
    {
        // validation for constraint: array
        if ('' !== ($nameArrayErrorMessage = self::validateNameForArrayConstraintsFromSetName($name))) {
            throw new \InvalidArgumentException($nameArrayErrorMessage, __LINE__);
        }
        $this->name = $name;
        return $this;
    }
    /**
     * Add item to name value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\ContactCategorySearchRowBasic
     */
    public function addToName(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The name 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->name[] = $item;
        return $this;
    }
    /**
     * Get private value
     * @return \StructType\SearchColumnBooleanField[]|null
     */
    public function getPrivate()
    {
        return $this->private;
    }
    /**
     * This method is responsible for validating the values passed to the setPrivate method
     * This method is willingly generated in order to preserve the one-line inline validation within the setPrivate method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validatePrivateForArrayConstraintsFromSetPrivate(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $contactCategorySearchRowBasicPrivateItem) {
            // validation for constraint: itemType
            if (!$contactCategorySearchRowBasicPrivateItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($contactCategorySearchRowBasicPrivateItem) ? get_class($contactCategorySearchRowBasicPrivateItem) : sprintf('%s(%s)', gettype($contactCategorySearchRowBasicPrivateItem), var_export($contactCategorySearchRowBasicPrivateItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The private 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 private value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField[] $private
     * @return \StructType\ContactCategorySearchRowBasic
     */
    public function setPrivate(array $private = array())
    {
        // validation for constraint: array
        if ('' !== ($privateArrayErrorMessage = self::validatePrivateForArrayConstraintsFromSetPrivate($private))) {
            throw new \InvalidArgumentException($privateArrayErrorMessage, __LINE__);
        }
        $this->private = $private;
        return $this;
    }
    /**
     * Add item to private value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField $item
     * @return \StructType\ContactCategorySearchRowBasic
     */
    public function addToPrivate(\StructType\SearchColumnBooleanField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnBooleanField) {
            throw new \InvalidArgumentException(sprintf('The private 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->private[] = $item;
        return $this;
    }
    /**
     * Get sync value
     * @return \StructType\SearchColumnBooleanField[]|null
     */
    public function getSync()
    {
        return $this->sync;
    }
    /**
     * This method is responsible for validating the values passed to the setSync method
     * This method is willingly generated in order to preserve the one-line inline validation within the setSync method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateSyncForArrayConstraintsFromSetSync(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $contactCategorySearchRowBasicSyncItem) {
            // validation for constraint: itemType
            if (!$contactCategorySearchRowBasicSyncItem instanceof \StructType\SearchColumnBooleanField) {
                $invalidValues[] = is_object($contactCategorySearchRowBasicSyncItem) ? get_class($contactCategorySearchRowBasicSyncItem) : sprintf('%s(%s)', gettype($contactCategorySearchRowBasicSyncItem), var_export($contactCategorySearchRowBasicSyncItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The sync 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 sync value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField[] $sync
     * @return \StructType\ContactCategorySearchRowBasic
     */
    public function setSync(array $sync = array())
    {
        // validation for constraint: array
        if ('' !== ($syncArrayErrorMessage = self::validateSyncForArrayConstraintsFromSetSync($sync))) {
            throw new \InvalidArgumentException($syncArrayErrorMessage, __LINE__);
        }
        $this->sync = $sync;
        return $this;
    }
    /**
     * Add item to sync value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnBooleanField $item
     * @return \StructType\ContactCategorySearchRowBasic
     */
    public function addToSync(\StructType\SearchColumnBooleanField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnBooleanField) {
            throw new \InvalidArgumentException(sprintf('The sync 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->sync[] = $item;
        return $this;
    }
}
