<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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