<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Recruiting_Assessment_Category_Response_DataType
 * StructType
 * Meta information extracted from the WSDL
 * - documentation: Recruiting Assessment Category Response Data
 * @subpackage Structs
 */
class Recruiting_Assessment_Category_Response_DataType extends AbstractStructBase
{
    /**
     * The Recruiting_Assessment_Category
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Recruiting_Assessment_CategoryType[]
     */
    public $Recruiting_Assessment_Category;
    /**
     * Constructor method for Recruiting_Assessment_Category_Response_DataType
     * @uses Recruiting_Assessment_Category_Response_DataType::setRecruiting_Assessment_Category()
     * @param \StructType\Recruiting_Assessment_CategoryType[] $recruiting_Assessment_Category
     */
    public function __construct(array $recruiting_Assessment_Category = array())
    {
        $this
            ->setRecruiting_Assessment_Category($recruiting_Assessment_Category);
    }
    /**
     * Get Recruiting_Assessment_Category value
     * @return \StructType\Recruiting_Assessment_CategoryType[]|null
     */
    public function getRecruiting_Assessment_Category()
    {
        return $this->Recruiting_Assessment_Category;
    }
    /**
     * This method is responsible for validating the values passed to the setRecruiting_Assessment_Category method
     * This method is willingly generated in order to preserve the one-line inline validation within the setRecruiting_Assessment_Category method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateRecruiting_Assessment_CategoryForArrayConstraintsFromSetRecruiting_Assessment_Category(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $recruiting_Assessment_Category_Response_DataTypeRecruiting_Assessment_CategoryItem) {
            // validation for constraint: itemType
            if (!$recruiting_Assessment_Category_Response_DataTypeRecruiting_Assessment_CategoryItem instanceof \StructType\Recruiting_Assessment_CategoryType) {
                $invalidValues[] = is_object($recruiting_Assessment_Category_Response_DataTypeRecruiting_Assessment_CategoryItem) ? get_class($recruiting_Assessment_Category_Response_DataTypeRecruiting_Assessment_CategoryItem) : sprintf('%s(%s)', gettype($recruiting_Assessment_Category_Response_DataTypeRecruiting_Assessment_CategoryItem), var_export($recruiting_Assessment_Category_Response_DataTypeRecruiting_Assessment_CategoryItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Recruiting_Assessment_Category property can only contain items of type \StructType\Recruiting_Assessment_CategoryType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Recruiting_Assessment_Category value
     * @throws \InvalidArgumentException
     * @param \StructType\Recruiting_Assessment_CategoryType[] $recruiting_Assessment_Category
     * @return \StructType\Recruiting_Assessment_Category_Response_DataType
     */
    public function setRecruiting_Assessment_Category(array $recruiting_Assessment_Category = array())
    {
        // validation for constraint: array
        if ('' !== ($recruiting_Assessment_CategoryArrayErrorMessage = self::validateRecruiting_Assessment_CategoryForArrayConstraintsFromSetRecruiting_Assessment_Category($recruiting_Assessment_Category))) {
            throw new \InvalidArgumentException($recruiting_Assessment_CategoryArrayErrorMessage, __LINE__);
        }
        $this->Recruiting_Assessment_Category = $recruiting_Assessment_Category;
        return $this;
    }
    /**
     * Add item to Recruiting_Assessment_Category value
     * @throws \InvalidArgumentException
     * @param \StructType\Recruiting_Assessment_CategoryType $item
     * @return \StructType\Recruiting_Assessment_Category_Response_DataType
     */
    public function addToRecruiting_Assessment_Category(\StructType\Recruiting_Assessment_CategoryType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Recruiting_Assessment_CategoryType) {
            throw new \InvalidArgumentException(sprintf('The Recruiting_Assessment_Category property can only contain items of type \StructType\Recruiting_Assessment_CategoryType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Recruiting_Assessment_Category[] = $item;
        return $this;
    }
}
