<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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