<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ResourceAllocationSearchRow StructType
 * @subpackage Structs
 */
class ResourceAllocationSearchRow extends SearchRow
{
    /**
     * The basic
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\ResourceAllocationSearchRowBasic
     */
    public $basic;
    /**
     * The customerJoin
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\CustomerSearchRowBasic
     */
    public $customerJoin;
    /**
     * The employeeJoin
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\EmployeeSearchRowBasic
     */
    public $employeeJoin;
    /**
     * The jobJoin
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\JobSearchRowBasic
     */
    public $jobJoin;
    /**
     * The projectTaskJoin
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\ProjectTaskSearchRowBasic
     */
    public $projectTaskJoin;
    /**
     * The requestedByJoin
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\EntitySearchRowBasic
     */
    public $requestedByJoin;
    /**
     * The resourceJoin
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\EntitySearchRowBasic
     */
    public $resourceJoin;
    /**
     * The userJoin
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\EmployeeSearchRowBasic
     */
    public $userJoin;
    /**
     * The vendorJoin
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\VendorSearchRowBasic
     */
    public $vendorJoin;
    /**
     * The customSearchJoin
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\CustomSearchRowBasic[]
     */
    public $customSearchJoin;
    /**
     * Constructor method for ResourceAllocationSearchRow
     * @uses ResourceAllocationSearchRow::setBasic()
     * @uses ResourceAllocationSearchRow::setCustomerJoin()
     * @uses ResourceAllocationSearchRow::setEmployeeJoin()
     * @uses ResourceAllocationSearchRow::setJobJoin()
     * @uses ResourceAllocationSearchRow::setProjectTaskJoin()
     * @uses ResourceAllocationSearchRow::setRequestedByJoin()
     * @uses ResourceAllocationSearchRow::setResourceJoin()
     * @uses ResourceAllocationSearchRow::setUserJoin()
     * @uses ResourceAllocationSearchRow::setVendorJoin()
     * @uses ResourceAllocationSearchRow::setCustomSearchJoin()
     * @param \StructType\ResourceAllocationSearchRowBasic $basic
     * @param \StructType\CustomerSearchRowBasic $customerJoin
     * @param \StructType\EmployeeSearchRowBasic $employeeJoin
     * @param \StructType\JobSearchRowBasic $jobJoin
     * @param \StructType\ProjectTaskSearchRowBasic $projectTaskJoin
     * @param \StructType\EntitySearchRowBasic $requestedByJoin
     * @param \StructType\EntitySearchRowBasic $resourceJoin
     * @param \StructType\EmployeeSearchRowBasic $userJoin
     * @param \StructType\VendorSearchRowBasic $vendorJoin
     * @param \StructType\CustomSearchRowBasic[] $customSearchJoin
     */
    public function __construct(\StructType\ResourceAllocationSearchRowBasic $basic = null, \StructType\CustomerSearchRowBasic $customerJoin = null, \StructType\EmployeeSearchRowBasic $employeeJoin = null, \StructType\JobSearchRowBasic $jobJoin = null, \StructType\ProjectTaskSearchRowBasic $projectTaskJoin = null, \StructType\EntitySearchRowBasic $requestedByJoin = null, \StructType\EntitySearchRowBasic $resourceJoin = null, \StructType\EmployeeSearchRowBasic $userJoin = null, \StructType\VendorSearchRowBasic $vendorJoin = null, array $customSearchJoin = array())
    {
        $this
            ->setBasic($basic)
            ->setCustomerJoin($customerJoin)
            ->setEmployeeJoin($employeeJoin)
            ->setJobJoin($jobJoin)
            ->setProjectTaskJoin($projectTaskJoin)
            ->setRequestedByJoin($requestedByJoin)
            ->setResourceJoin($resourceJoin)
            ->setUserJoin($userJoin)
            ->setVendorJoin($vendorJoin)
            ->setCustomSearchJoin($customSearchJoin);
    }
    /**
     * Get basic value
     * @return \StructType\ResourceAllocationSearchRowBasic|null
     */
    public function getBasic()
    {
        return $this->basic;
    }
    /**
     * Set basic value
     * @param \StructType\ResourceAllocationSearchRowBasic $basic
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function setBasic(\StructType\ResourceAllocationSearchRowBasic $basic = null)
    {
        $this->basic = $basic;
        return $this;
    }
    /**
     * Get customerJoin value
     * @return \StructType\CustomerSearchRowBasic|null
     */
    public function getCustomerJoin()
    {
        return $this->customerJoin;
    }
    /**
     * Set customerJoin value
     * @param \StructType\CustomerSearchRowBasic $customerJoin
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function setCustomerJoin(\StructType\CustomerSearchRowBasic $customerJoin = null)
    {
        $this->customerJoin = $customerJoin;
        return $this;
    }
    /**
     * Get employeeJoin value
     * @return \StructType\EmployeeSearchRowBasic|null
     */
    public function getEmployeeJoin()
    {
        return $this->employeeJoin;
    }
    /**
     * Set employeeJoin value
     * @param \StructType\EmployeeSearchRowBasic $employeeJoin
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function setEmployeeJoin(\StructType\EmployeeSearchRowBasic $employeeJoin = null)
    {
        $this->employeeJoin = $employeeJoin;
        return $this;
    }
    /**
     * Get jobJoin value
     * @return \StructType\JobSearchRowBasic|null
     */
    public function getJobJoin()
    {
        return $this->jobJoin;
    }
    /**
     * Set jobJoin value
     * @param \StructType\JobSearchRowBasic $jobJoin
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function setJobJoin(\StructType\JobSearchRowBasic $jobJoin = null)
    {
        $this->jobJoin = $jobJoin;
        return $this;
    }
    /**
     * Get projectTaskJoin value
     * @return \StructType\ProjectTaskSearchRowBasic|null
     */
    public function getProjectTaskJoin()
    {
        return $this->projectTaskJoin;
    }
    /**
     * Set projectTaskJoin value
     * @param \StructType\ProjectTaskSearchRowBasic $projectTaskJoin
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function setProjectTaskJoin(\StructType\ProjectTaskSearchRowBasic $projectTaskJoin = null)
    {
        $this->projectTaskJoin = $projectTaskJoin;
        return $this;
    }
    /**
     * Get requestedByJoin value
     * @return \StructType\EntitySearchRowBasic|null
     */
    public function getRequestedByJoin()
    {
        return $this->requestedByJoin;
    }
    /**
     * Set requestedByJoin value
     * @param \StructType\EntitySearchRowBasic $requestedByJoin
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function setRequestedByJoin(\StructType\EntitySearchRowBasic $requestedByJoin = null)
    {
        $this->requestedByJoin = $requestedByJoin;
        return $this;
    }
    /**
     * Get resourceJoin value
     * @return \StructType\EntitySearchRowBasic|null
     */
    public function getResourceJoin()
    {
        return $this->resourceJoin;
    }
    /**
     * Set resourceJoin value
     * @param \StructType\EntitySearchRowBasic $resourceJoin
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function setResourceJoin(\StructType\EntitySearchRowBasic $resourceJoin = null)
    {
        $this->resourceJoin = $resourceJoin;
        return $this;
    }
    /**
     * Get userJoin value
     * @return \StructType\EmployeeSearchRowBasic|null
     */
    public function getUserJoin()
    {
        return $this->userJoin;
    }
    /**
     * Set userJoin value
     * @param \StructType\EmployeeSearchRowBasic $userJoin
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function setUserJoin(\StructType\EmployeeSearchRowBasic $userJoin = null)
    {
        $this->userJoin = $userJoin;
        return $this;
    }
    /**
     * Get vendorJoin value
     * @return \StructType\VendorSearchRowBasic|null
     */
    public function getVendorJoin()
    {
        return $this->vendorJoin;
    }
    /**
     * Set vendorJoin value
     * @param \StructType\VendorSearchRowBasic $vendorJoin
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function setVendorJoin(\StructType\VendorSearchRowBasic $vendorJoin = null)
    {
        $this->vendorJoin = $vendorJoin;
        return $this;
    }
    /**
     * Get customSearchJoin value
     * @return \StructType\CustomSearchRowBasic[]|null
     */
    public function getCustomSearchJoin()
    {
        return $this->customSearchJoin;
    }
    /**
     * This method is responsible for validating the values passed to the setCustomSearchJoin method
     * This method is willingly generated in order to preserve the one-line inline validation within the setCustomSearchJoin method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateCustomSearchJoinForArrayConstraintsFromSetCustomSearchJoin(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $resourceAllocationSearchRowCustomSearchJoinItem) {
            // validation for constraint: itemType
            if (!$resourceAllocationSearchRowCustomSearchJoinItem instanceof \StructType\CustomSearchRowBasic) {
                $invalidValues[] = is_object($resourceAllocationSearchRowCustomSearchJoinItem) ? get_class($resourceAllocationSearchRowCustomSearchJoinItem) : sprintf('%s(%s)', gettype($resourceAllocationSearchRowCustomSearchJoinItem), var_export($resourceAllocationSearchRowCustomSearchJoinItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The customSearchJoin property can only contain items of type \StructType\CustomSearchRowBasic, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set customSearchJoin value
     * @throws \InvalidArgumentException
     * @param \StructType\CustomSearchRowBasic[] $customSearchJoin
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function setCustomSearchJoin(array $customSearchJoin = array())
    {
        // validation for constraint: array
        if ('' !== ($customSearchJoinArrayErrorMessage = self::validateCustomSearchJoinForArrayConstraintsFromSetCustomSearchJoin($customSearchJoin))) {
            throw new \InvalidArgumentException($customSearchJoinArrayErrorMessage, __LINE__);
        }
        $this->customSearchJoin = $customSearchJoin;
        return $this;
    }
    /**
     * Add item to customSearchJoin value
     * @throws \InvalidArgumentException
     * @param \StructType\CustomSearchRowBasic $item
     * @return \StructType\ResourceAllocationSearchRow
     */
    public function addToCustomSearchJoin(\StructType\CustomSearchRowBasic $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\CustomSearchRowBasic) {
            throw new \InvalidArgumentException(sprintf('The customSearchJoin property can only contain items of type \StructType\CustomSearchRowBasic, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->customSearchJoin[] = $item;
        return $this;
    }
}
