<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Worker_Utilization_Target_Sheets_Request_CriteriaType
 * StructType
 * Meta information extracted from the WSDL
 * - documentation: Element Container for Worker Utilization Target Sheets Request Criteria
 * @subpackage Structs
 */
class Worker_Utilization_Target_Sheets_Request_CriteriaType extends AbstractStructBase
{
    /**
     * The Worker_Utilization_Target_Sheet_Company_Reference
     * Meta information extracted from the WSDL
     * - documentation: Company
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\CompanyObjectType[]
     */
    public $Worker_Utilization_Target_Sheet_Company_Reference;
    /**
     * The Worker_Utilization_Target_Sheet_Effective_Date
     * Meta information extracted from the WSDL
     * - documentation: Effective Date
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Worker_Utilization_Target_Sheet_Effective_Date;
    /**
     * Constructor method for Worker_Utilization_Target_Sheets_Request_CriteriaType
     * @uses Worker_Utilization_Target_Sheets_Request_CriteriaType::setWorker_Utilization_Target_Sheet_Company_Reference()
     * @uses Worker_Utilization_Target_Sheets_Request_CriteriaType::setWorker_Utilization_Target_Sheet_Effective_Date()
     * @param \StructType\CompanyObjectType[] $worker_Utilization_Target_Sheet_Company_Reference
     * @param string $worker_Utilization_Target_Sheet_Effective_Date
     */
    public function __construct(array $worker_Utilization_Target_Sheet_Company_Reference = array(), $worker_Utilization_Target_Sheet_Effective_Date = null)
    {
        $this
            ->setWorker_Utilization_Target_Sheet_Company_Reference($worker_Utilization_Target_Sheet_Company_Reference)
            ->setWorker_Utilization_Target_Sheet_Effective_Date($worker_Utilization_Target_Sheet_Effective_Date);
    }
    /**
     * Get Worker_Utilization_Target_Sheet_Company_Reference value
     * @return \StructType\CompanyObjectType[]|null
     */
    public function getWorker_Utilization_Target_Sheet_Company_Reference()
    {
        return $this->Worker_Utilization_Target_Sheet_Company_Reference;
    }
    /**
     * This method is responsible for validating the values passed to the setWorker_Utilization_Target_Sheet_Company_Reference method
     * This method is willingly generated in order to preserve the one-line inline validation within the setWorker_Utilization_Target_Sheet_Company_Reference 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_Company_ReferenceForArrayConstraintsFromSetWorker_Utilization_Target_Sheet_Company_Reference(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $worker_Utilization_Target_Sheets_Request_CriteriaTypeWorker_Utilization_Target_Sheet_Company_ReferenceItem) {
            // validation for constraint: itemType
            if (!$worker_Utilization_Target_Sheets_Request_CriteriaTypeWorker_Utilization_Target_Sheet_Company_ReferenceItem instanceof \StructType\CompanyObjectType) {
                $invalidValues[] = is_object($worker_Utilization_Target_Sheets_Request_CriteriaTypeWorker_Utilization_Target_Sheet_Company_ReferenceItem) ? get_class($worker_Utilization_Target_Sheets_Request_CriteriaTypeWorker_Utilization_Target_Sheet_Company_ReferenceItem) : sprintf('%s(%s)', gettype($worker_Utilization_Target_Sheets_Request_CriteriaTypeWorker_Utilization_Target_Sheet_Company_ReferenceItem), var_export($worker_Utilization_Target_Sheets_Request_CriteriaTypeWorker_Utilization_Target_Sheet_Company_ReferenceItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Worker_Utilization_Target_Sheet_Company_Reference property can only contain items of type \StructType\CompanyObjectType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Worker_Utilization_Target_Sheet_Company_Reference value
     * @throws \InvalidArgumentException
     * @param \StructType\CompanyObjectType[] $worker_Utilization_Target_Sheet_Company_Reference
     * @return \StructType\Worker_Utilization_Target_Sheets_Request_CriteriaType
     */
    public function setWorker_Utilization_Target_Sheet_Company_Reference(array $worker_Utilization_Target_Sheet_Company_Reference = array())
    {
        // validation for constraint: array
        if ('' !== ($worker_Utilization_Target_Sheet_Company_ReferenceArrayErrorMessage = self::validateWorker_Utilization_Target_Sheet_Company_ReferenceForArrayConstraintsFromSetWorker_Utilization_Target_Sheet_Company_Reference($worker_Utilization_Target_Sheet_Company_Reference))) {
            throw new \InvalidArgumentException($worker_Utilization_Target_Sheet_Company_ReferenceArrayErrorMessage, __LINE__);
        }
        $this->Worker_Utilization_Target_Sheet_Company_Reference = $worker_Utilization_Target_Sheet_Company_Reference;
        return $this;
    }
    /**
     * Add item to Worker_Utilization_Target_Sheet_Company_Reference value
     * @throws \InvalidArgumentException
     * @param \StructType\CompanyObjectType $item
     * @return \StructType\Worker_Utilization_Target_Sheets_Request_CriteriaType
     */
    public function addToWorker_Utilization_Target_Sheet_Company_Reference(\StructType\CompanyObjectType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\CompanyObjectType) {
            throw new \InvalidArgumentException(sprintf('The Worker_Utilization_Target_Sheet_Company_Reference property can only contain items of type \StructType\CompanyObjectType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Worker_Utilization_Target_Sheet_Company_Reference[] = $item;
        return $this;
    }
    /**
     * Get Worker_Utilization_Target_Sheet_Effective_Date value
     * @return string|null
     */
    public function getWorker_Utilization_Target_Sheet_Effective_Date()
    {
        return $this->Worker_Utilization_Target_Sheet_Effective_Date;
    }
    /**
     * Set Worker_Utilization_Target_Sheet_Effective_Date value
     * @param string $worker_Utilization_Target_Sheet_Effective_Date
     * @return \StructType\Worker_Utilization_Target_Sheets_Request_CriteriaType
     */
    public function setWorker_Utilization_Target_Sheet_Effective_Date($worker_Utilization_Target_Sheet_Effective_Date = null)
    {
        // validation for constraint: string
        if (!is_null($worker_Utilization_Target_Sheet_Effective_Date) && !is_string($worker_Utilization_Target_Sheet_Effective_Date)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($worker_Utilization_Target_Sheet_Effective_Date, true), gettype($worker_Utilization_Target_Sheet_Effective_Date)), __LINE__);
        }
        $this->Worker_Utilization_Target_Sheet_Effective_Date = $worker_Utilization_Target_Sheet_Effective_Date;
        return $this;
    }
}
