<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Worker_Utilization_Target_SheetType StructType
 * Meta information extracted from the WSDL
 * - documentation: Element Container for Worker Utilization Target Sheet
 * @subpackage Structs
 */
class Worker_Utilization_Target_SheetType extends AbstractStructBase
{
    /**
     * The Worker_Utilization_Target_Sheet_Request_Reference
     * Meta information extracted from the WSDL
     * - documentation: Utilization Target Sheet Reference
     * - minOccurs: 0
     * @var \StructType\Utilization_Target_SheetObjectType
     */
    public $Worker_Utilization_Target_Sheet_Request_Reference;
    /**
     * The Worker_Utilization_Target_Sheet_Data
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Worker_Utilization_Target_Sheet_DataType[]
     */
    public $Worker_Utilization_Target_Sheet_Data;
    /**
     * Constructor method for Worker_Utilization_Target_SheetType
     * @uses Worker_Utilization_Target_SheetType::setWorker_Utilization_Target_Sheet_Request_Reference()
     * @uses Worker_Utilization_Target_SheetType::setWorker_Utilization_Target_Sheet_Data()
     * @param \StructType\Utilization_Target_SheetObjectType $worker_Utilization_Target_Sheet_Request_Reference
     * @param \StructType\Worker_Utilization_Target_Sheet_DataType[] $worker_Utilization_Target_Sheet_Data
     */
    public function __construct(\StructType\Utilization_Target_SheetObjectType $worker_Utilization_Target_Sheet_Request_Reference = null, array $worker_Utilization_Target_Sheet_Data = array())
    {
        $this
            ->setWorker_Utilization_Target_Sheet_Request_Reference($worker_Utilization_Target_Sheet_Request_Reference)
            ->setWorker_Utilization_Target_Sheet_Data($worker_Utilization_Target_Sheet_Data);
    }
    /**
     * Get Worker_Utilization_Target_Sheet_Request_Reference value
     * @return \StructType\Utilization_Target_SheetObjectType|null
     */
    public function getWorker_Utilization_Target_Sheet_Request_Reference()
    {
        return $this->Worker_Utilization_Target_Sheet_Request_Reference;
    }
    /**
     * Set Worker_Utilization_Target_Sheet_Request_Reference value
     * @param \StructType\Utilization_Target_SheetObjectType $worker_Utilization_Target_Sheet_Request_Reference
     * @return \StructType\Worker_Utilization_Target_SheetType
     */
    public function setWorker_Utilization_Target_Sheet_Request_Reference(\StructType\Utilization_Target_SheetObjectType $worker_Utilization_Target_Sheet_Request_Reference = null)
    {
        $this->Worker_Utilization_Target_Sheet_Request_Reference = $worker_Utilization_Target_Sheet_Request_Reference;
        return $this;
    }
    /**
     * Get Worker_Utilization_Target_Sheet_Data value
     * @return \StructType\Worker_Utilization_Target_Sheet_DataType[]|null
     */
    public function getWorker_Utilization_Target_Sheet_Data()
    {
        return $this->Worker_Utilization_Target_Sheet_Data;
    }
    /**
     * This method is responsible for validating the values passed to the setWorker_Utilization_Target_Sheet_Data method
     * This method is willingly generated in order to preserve the one-line inline validation within the setWorker_Utilization_Target_Sheet_Data 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_Sheet_DataForArrayConstraintsFromSetWorker_Utilization_Target_Sheet_Data(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $worker_Utilization_Target_SheetTypeWorker_Utilization_Target_Sheet_DataItem) {
            // validation for constraint: itemType
            if (!$worker_Utilization_Target_SheetTypeWorker_Utilization_Target_Sheet_DataItem instanceof \StructType\Worker_Utilization_Target_Sheet_DataType) {
                $invalidValues[] = is_object($worker_Utilization_Target_SheetTypeWorker_Utilization_Target_Sheet_DataItem) ? get_class($worker_Utilization_Target_SheetTypeWorker_Utilization_Target_Sheet_DataItem) : sprintf('%s(%s)', gettype($worker_Utilization_Target_SheetTypeWorker_Utilization_Target_Sheet_DataItem), var_export($worker_Utilization_Target_SheetTypeWorker_Utilization_Target_Sheet_DataItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Worker_Utilization_Target_Sheet_Data property can only contain items of type \StructType\Worker_Utilization_Target_Sheet_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Worker_Utilization_Target_Sheet_Data value
     * @throws \InvalidArgumentException
     * @param \StructType\Worker_Utilization_Target_Sheet_DataType[] $worker_Utilization_Target_Sheet_Data
     * @return \StructType\Worker_Utilization_Target_SheetType
     */
    public function setWorker_Utilization_Target_Sheet_Data(array $worker_Utilization_Target_Sheet_Data = array())
    {
        // validation for constraint: array
        if ('' !== ($worker_Utilization_Target_Sheet_DataArrayErrorMessage = self::validateWorker_Utilization_Target_Sheet_DataForArrayConstraintsFromSetWorker_Utilization_Target_Sheet_Data($worker_Utilization_Target_Sheet_Data))) {
            throw new \InvalidArgumentException($worker_Utilization_Target_Sheet_DataArrayErrorMessage, __LINE__);
        }
        $this->Worker_Utilization_Target_Sheet_Data = $worker_Utilization_Target_Sheet_Data;
        return $this;
    }
    /**
     * Add item to Worker_Utilization_Target_Sheet_Data value
     * @throws \InvalidArgumentException
     * @param \StructType\Worker_Utilization_Target_Sheet_DataType $item
     * @return \StructType\Worker_Utilization_Target_SheetType
     */
    public function addToWorker_Utilization_Target_Sheet_Data(\StructType\Worker_Utilization_Target_Sheet_DataType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Worker_Utilization_Target_Sheet_DataType) {
            throw new \InvalidArgumentException(sprintf('The Worker_Utilization_Target_Sheet_Data property can only contain items of type \StructType\Worker_Utilization_Target_Sheet_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Worker_Utilization_Target_Sheet_Data[] = $item;
        return $this;
    }
}
