<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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