<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for NoteSearchRowBasic StructType
 * @subpackage Structs
 */
class NoteSearchRowBasic extends SearchRowBasic
{
    /**
     * The author
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnSelectField[]
     */
    public $author;
    /**
     * The direction
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $direction;
    /**
     * 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 note
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $note;
    /**
     * The noteDate
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnDateField[]
     */
    public $noteDate;
    /**
     * The noteType
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $noteType;
    /**
     * The title
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SearchColumnStringField[]
     */
    public $title;
    /**
     * The customFieldList
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\SearchColumnCustomFieldList
     */
    public $customFieldList;
    /**
     * Constructor method for NoteSearchRowBasic
     * @uses NoteSearchRowBasic::setAuthor()
     * @uses NoteSearchRowBasic::setDirection()
     * @uses NoteSearchRowBasic::setExternalId()
     * @uses NoteSearchRowBasic::setInternalId()
     * @uses NoteSearchRowBasic::setNote()
     * @uses NoteSearchRowBasic::setNoteDate()
     * @uses NoteSearchRowBasic::setNoteType()
     * @uses NoteSearchRowBasic::setTitle()
     * @uses NoteSearchRowBasic::setCustomFieldList()
     * @param \StructType\SearchColumnSelectField[] $author
     * @param \StructType\SearchColumnStringField[] $direction
     * @param \StructType\SearchColumnSelectField[] $externalId
     * @param \StructType\SearchColumnSelectField[] $internalId
     * @param \StructType\SearchColumnStringField[] $note
     * @param \StructType\SearchColumnDateField[] $noteDate
     * @param \StructType\SearchColumnStringField[] $noteType
     * @param \StructType\SearchColumnStringField[] $title
     * @param \StructType\SearchColumnCustomFieldList $customFieldList
     */
    public function __construct(array $author = array(), array $direction = array(), array $externalId = array(), array $internalId = array(), array $note = array(), array $noteDate = array(), array $noteType = array(), array $title = array(), \StructType\SearchColumnCustomFieldList $customFieldList = null)
    {
        $this
            ->setAuthor($author)
            ->setDirection($direction)
            ->setExternalId($externalId)
            ->setInternalId($internalId)
            ->setNote($note)
            ->setNoteDate($noteDate)
            ->setNoteType($noteType)
            ->setTitle($title)
            ->setCustomFieldList($customFieldList);
    }
    /**
     * Get author value
     * @return \StructType\SearchColumnSelectField[]|null
     */
    public function getAuthor()
    {
        return $this->author;
    }
    /**
     * This method is responsible for validating the values passed to the setAuthor method
     * This method is willingly generated in order to preserve the one-line inline validation within the setAuthor method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateAuthorForArrayConstraintsFromSetAuthor(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $noteSearchRowBasicAuthorItem) {
            // validation for constraint: itemType
            if (!$noteSearchRowBasicAuthorItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($noteSearchRowBasicAuthorItem) ? get_class($noteSearchRowBasicAuthorItem) : sprintf('%s(%s)', gettype($noteSearchRowBasicAuthorItem), var_export($noteSearchRowBasicAuthorItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The author 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 author value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField[] $author
     * @return \StructType\NoteSearchRowBasic
     */
    public function setAuthor(array $author = array())
    {
        // validation for constraint: array
        if ('' !== ($authorArrayErrorMessage = self::validateAuthorForArrayConstraintsFromSetAuthor($author))) {
            throw new \InvalidArgumentException($authorArrayErrorMessage, __LINE__);
        }
        $this->author = $author;
        return $this;
    }
    /**
     * Add item to author value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnSelectField $item
     * @return \StructType\NoteSearchRowBasic
     */
    public function addToAuthor(\StructType\SearchColumnSelectField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnSelectField) {
            throw new \InvalidArgumentException(sprintf('The author 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->author[] = $item;
        return $this;
    }
    /**
     * Get direction value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getDirection()
    {
        return $this->direction;
    }
    /**
     * This method is responsible for validating the values passed to the setDirection method
     * This method is willingly generated in order to preserve the one-line inline validation within the setDirection method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateDirectionForArrayConstraintsFromSetDirection(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $noteSearchRowBasicDirectionItem) {
            // validation for constraint: itemType
            if (!$noteSearchRowBasicDirectionItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($noteSearchRowBasicDirectionItem) ? get_class($noteSearchRowBasicDirectionItem) : sprintf('%s(%s)', gettype($noteSearchRowBasicDirectionItem), var_export($noteSearchRowBasicDirectionItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The direction 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 direction value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $direction
     * @return \StructType\NoteSearchRowBasic
     */
    public function setDirection(array $direction = array())
    {
        // validation for constraint: array
        if ('' !== ($directionArrayErrorMessage = self::validateDirectionForArrayConstraintsFromSetDirection($direction))) {
            throw new \InvalidArgumentException($directionArrayErrorMessage, __LINE__);
        }
        $this->direction = $direction;
        return $this;
    }
    /**
     * Add item to direction value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\NoteSearchRowBasic
     */
    public function addToDirection(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The direction 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->direction[] = $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 $noteSearchRowBasicExternalIdItem) {
            // validation for constraint: itemType
            if (!$noteSearchRowBasicExternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($noteSearchRowBasicExternalIdItem) ? get_class($noteSearchRowBasicExternalIdItem) : sprintf('%s(%s)', gettype($noteSearchRowBasicExternalIdItem), var_export($noteSearchRowBasicExternalIdItem, 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\NoteSearchRowBasic
     */
    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\NoteSearchRowBasic
     */
    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 $noteSearchRowBasicInternalIdItem) {
            // validation for constraint: itemType
            if (!$noteSearchRowBasicInternalIdItem instanceof \StructType\SearchColumnSelectField) {
                $invalidValues[] = is_object($noteSearchRowBasicInternalIdItem) ? get_class($noteSearchRowBasicInternalIdItem) : sprintf('%s(%s)', gettype($noteSearchRowBasicInternalIdItem), var_export($noteSearchRowBasicInternalIdItem, 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\NoteSearchRowBasic
     */
    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\NoteSearchRowBasic
     */
    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 note value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getNote()
    {
        return $this->note;
    }
    /**
     * This method is responsible for validating the values passed to the setNote method
     * This method is willingly generated in order to preserve the one-line inline validation within the setNote method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateNoteForArrayConstraintsFromSetNote(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $noteSearchRowBasicNoteItem) {
            // validation for constraint: itemType
            if (!$noteSearchRowBasicNoteItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($noteSearchRowBasicNoteItem) ? get_class($noteSearchRowBasicNoteItem) : sprintf('%s(%s)', gettype($noteSearchRowBasicNoteItem), var_export($noteSearchRowBasicNoteItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The note 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 note value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $note
     * @return \StructType\NoteSearchRowBasic
     */
    public function setNote(array $note = array())
    {
        // validation for constraint: array
        if ('' !== ($noteArrayErrorMessage = self::validateNoteForArrayConstraintsFromSetNote($note))) {
            throw new \InvalidArgumentException($noteArrayErrorMessage, __LINE__);
        }
        $this->note = $note;
        return $this;
    }
    /**
     * Add item to note value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\NoteSearchRowBasic
     */
    public function addToNote(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The note 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->note[] = $item;
        return $this;
    }
    /**
     * Get noteDate value
     * @return \StructType\SearchColumnDateField[]|null
     */
    public function getNoteDate()
    {
        return $this->noteDate;
    }
    /**
     * This method is responsible for validating the values passed to the setNoteDate method
     * This method is willingly generated in order to preserve the one-line inline validation within the setNoteDate method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateNoteDateForArrayConstraintsFromSetNoteDate(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $noteSearchRowBasicNoteDateItem) {
            // validation for constraint: itemType
            if (!$noteSearchRowBasicNoteDateItem instanceof \StructType\SearchColumnDateField) {
                $invalidValues[] = is_object($noteSearchRowBasicNoteDateItem) ? get_class($noteSearchRowBasicNoteDateItem) : sprintf('%s(%s)', gettype($noteSearchRowBasicNoteDateItem), var_export($noteSearchRowBasicNoteDateItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The noteDate property can only contain items of type \StructType\SearchColumnDateField, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set noteDate value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDateField[] $noteDate
     * @return \StructType\NoteSearchRowBasic
     */
    public function setNoteDate(array $noteDate = array())
    {
        // validation for constraint: array
        if ('' !== ($noteDateArrayErrorMessage = self::validateNoteDateForArrayConstraintsFromSetNoteDate($noteDate))) {
            throw new \InvalidArgumentException($noteDateArrayErrorMessage, __LINE__);
        }
        $this->noteDate = $noteDate;
        return $this;
    }
    /**
     * Add item to noteDate value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnDateField $item
     * @return \StructType\NoteSearchRowBasic
     */
    public function addToNoteDate(\StructType\SearchColumnDateField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnDateField) {
            throw new \InvalidArgumentException(sprintf('The noteDate property can only contain items of type \StructType\SearchColumnDateField, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->noteDate[] = $item;
        return $this;
    }
    /**
     * Get noteType value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getNoteType()
    {
        return $this->noteType;
    }
    /**
     * This method is responsible for validating the values passed to the setNoteType method
     * This method is willingly generated in order to preserve the one-line inline validation within the setNoteType method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateNoteTypeForArrayConstraintsFromSetNoteType(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $noteSearchRowBasicNoteTypeItem) {
            // validation for constraint: itemType
            if (!$noteSearchRowBasicNoteTypeItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($noteSearchRowBasicNoteTypeItem) ? get_class($noteSearchRowBasicNoteTypeItem) : sprintf('%s(%s)', gettype($noteSearchRowBasicNoteTypeItem), var_export($noteSearchRowBasicNoteTypeItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The noteType 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 noteType value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $noteType
     * @return \StructType\NoteSearchRowBasic
     */
    public function setNoteType(array $noteType = array())
    {
        // validation for constraint: array
        if ('' !== ($noteTypeArrayErrorMessage = self::validateNoteTypeForArrayConstraintsFromSetNoteType($noteType))) {
            throw new \InvalidArgumentException($noteTypeArrayErrorMessage, __LINE__);
        }
        $this->noteType = $noteType;
        return $this;
    }
    /**
     * Add item to noteType value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\NoteSearchRowBasic
     */
    public function addToNoteType(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The noteType 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->noteType[] = $item;
        return $this;
    }
    /**
     * Get title value
     * @return \StructType\SearchColumnStringField[]|null
     */
    public function getTitle()
    {
        return $this->title;
    }
    /**
     * This method is responsible for validating the values passed to the setTitle method
     * This method is willingly generated in order to preserve the one-line inline validation within the setTitle method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateTitleForArrayConstraintsFromSetTitle(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $noteSearchRowBasicTitleItem) {
            // validation for constraint: itemType
            if (!$noteSearchRowBasicTitleItem instanceof \StructType\SearchColumnStringField) {
                $invalidValues[] = is_object($noteSearchRowBasicTitleItem) ? get_class($noteSearchRowBasicTitleItem) : sprintf('%s(%s)', gettype($noteSearchRowBasicTitleItem), var_export($noteSearchRowBasicTitleItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The title 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 title value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField[] $title
     * @return \StructType\NoteSearchRowBasic
     */
    public function setTitle(array $title = array())
    {
        // validation for constraint: array
        if ('' !== ($titleArrayErrorMessage = self::validateTitleForArrayConstraintsFromSetTitle($title))) {
            throw new \InvalidArgumentException($titleArrayErrorMessage, __LINE__);
        }
        $this->title = $title;
        return $this;
    }
    /**
     * Add item to title value
     * @throws \InvalidArgumentException
     * @param \StructType\SearchColumnStringField $item
     * @return \StructType\NoteSearchRowBasic
     */
    public function addToTitle(\StructType\SearchColumnStringField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SearchColumnStringField) {
            throw new \InvalidArgumentException(sprintf('The title 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->title[] = $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\NoteSearchRowBasic
     */
    public function setCustomFieldList(\StructType\SearchColumnCustomFieldList $customFieldList = null)
    {
        $this->customFieldList = $customFieldList;
        return $this;
    }
}
