<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Supplier_Invoice_System_Validation_ConfigurationType
 * StructType
 * Meta information extracted from the WSDL
 * - documentation: Element that includes Supplier Invoice System Validation Configuration Instance and Data
 * @subpackage Structs
 */
class Supplier_Invoice_System_Validation_ConfigurationType extends AbstractStructBase
{
    /**
     * The Supplier_Invoice_System_Validation_Configuration_Reference
     * Meta information extracted from the WSDL
     * - documentation: Supplier Invoice System Validation Configuration Reference
     * - minOccurs: 0
     * @var \StructType\Supplier_Invoice_System_Validation_ConfigurationObjectType
     */
    public $Supplier_Invoice_System_Validation_Configuration_Reference;
    /**
     * The Supplier_Invoice_System_Validation_Configuration_Data
     * Meta information extracted from the WSDL
     * - documentation: Supplier Invoice System Validation Configuration replacement data.
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\Supplier_Invoice_Validation_Configuration_DataType[]
     */
    public $Supplier_Invoice_System_Validation_Configuration_Data;
    /**
     * Constructor method for Supplier_Invoice_System_Validation_ConfigurationType
     * @uses Supplier_Invoice_System_Validation_ConfigurationType::setSupplier_Invoice_System_Validation_Configuration_Reference()
     * @uses Supplier_Invoice_System_Validation_ConfigurationType::setSupplier_Invoice_System_Validation_Configuration_Data()
     * @param \StructType\Supplier_Invoice_System_Validation_ConfigurationObjectType $supplier_Invoice_System_Validation_Configuration_Reference
     * @param \StructType\Supplier_Invoice_Validation_Configuration_DataType[] $supplier_Invoice_System_Validation_Configuration_Data
     */
    public function __construct(\StructType\Supplier_Invoice_System_Validation_ConfigurationObjectType $supplier_Invoice_System_Validation_Configuration_Reference = null, array $supplier_Invoice_System_Validation_Configuration_Data = array())
    {
        $this
            ->setSupplier_Invoice_System_Validation_Configuration_Reference($supplier_Invoice_System_Validation_Configuration_Reference)
            ->setSupplier_Invoice_System_Validation_Configuration_Data($supplier_Invoice_System_Validation_Configuration_Data);
    }
    /**
     * Get Supplier_Invoice_System_Validation_Configuration_Reference value
     * @return \StructType\Supplier_Invoice_System_Validation_ConfigurationObjectType|null
     */
    public function getSupplier_Invoice_System_Validation_Configuration_Reference()
    {
        return $this->Supplier_Invoice_System_Validation_Configuration_Reference;
    }
    /**
     * Set Supplier_Invoice_System_Validation_Configuration_Reference value
     * @param \StructType\Supplier_Invoice_System_Validation_ConfigurationObjectType $supplier_Invoice_System_Validation_Configuration_Reference
     * @return \StructType\Supplier_Invoice_System_Validation_ConfigurationType
     */
    public function setSupplier_Invoice_System_Validation_Configuration_Reference(\StructType\Supplier_Invoice_System_Validation_ConfigurationObjectType $supplier_Invoice_System_Validation_Configuration_Reference = null)
    {
        $this->Supplier_Invoice_System_Validation_Configuration_Reference = $supplier_Invoice_System_Validation_Configuration_Reference;
        return $this;
    }
    /**
     * Get Supplier_Invoice_System_Validation_Configuration_Data value
     * @return \StructType\Supplier_Invoice_Validation_Configuration_DataType[]|null
     */
    public function getSupplier_Invoice_System_Validation_Configuration_Data()
    {
        return $this->Supplier_Invoice_System_Validation_Configuration_Data;
    }
    /**
     * This method is responsible for validating the values passed to the setSupplier_Invoice_System_Validation_Configuration_Data method
     * This method is willingly generated in order to preserve the one-line inline validation within the setSupplier_Invoice_System_Validation_Configuration_Data method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateSupplier_Invoice_System_Validation_Configuration_DataForArrayConstraintsFromSetSupplier_Invoice_System_Validation_Configuration_Data(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $supplier_Invoice_System_Validation_ConfigurationTypeSupplier_Invoice_System_Validation_Configuration_DataItem) {
            // validation for constraint: itemType
            if (!$supplier_Invoice_System_Validation_ConfigurationTypeSupplier_Invoice_System_Validation_Configuration_DataItem instanceof \StructType\Supplier_Invoice_Validation_Configuration_DataType) {
                $invalidValues[] = is_object($supplier_Invoice_System_Validation_ConfigurationTypeSupplier_Invoice_System_Validation_Configuration_DataItem) ? get_class($supplier_Invoice_System_Validation_ConfigurationTypeSupplier_Invoice_System_Validation_Configuration_DataItem) : sprintf('%s(%s)', gettype($supplier_Invoice_System_Validation_ConfigurationTypeSupplier_Invoice_System_Validation_Configuration_DataItem), var_export($supplier_Invoice_System_Validation_ConfigurationTypeSupplier_Invoice_System_Validation_Configuration_DataItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The Supplier_Invoice_System_Validation_Configuration_Data property can only contain items of type \StructType\Supplier_Invoice_Validation_Configuration_DataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set Supplier_Invoice_System_Validation_Configuration_Data value
     * @throws \InvalidArgumentException
     * @param \StructType\Supplier_Invoice_Validation_Configuration_DataType[] $supplier_Invoice_System_Validation_Configuration_Data
     * @return \StructType\Supplier_Invoice_System_Validation_ConfigurationType
     */
    public function setSupplier_Invoice_System_Validation_Configuration_Data(array $supplier_Invoice_System_Validation_Configuration_Data = array())
    {
        // validation for constraint: array
        if ('' !== ($supplier_Invoice_System_Validation_Configuration_DataArrayErrorMessage = self::validateSupplier_Invoice_System_Validation_Configuration_DataForArrayConstraintsFromSetSupplier_Invoice_System_Validation_Configuration_Data($supplier_Invoice_System_Validation_Configuration_Data))) {
            throw new \InvalidArgumentException($supplier_Invoice_System_Validation_Configuration_DataArrayErrorMessage, __LINE__);
        }
        $this->Supplier_Invoice_System_Validation_Configuration_Data = $supplier_Invoice_System_Validation_Configuration_Data;
        return $this;
    }
    /**
     * Add item to Supplier_Invoice_System_Validation_Configuration_Data value
     * @throws \InvalidArgumentException
     * @param \StructType\Supplier_Invoice_Validation_Configuration_DataType $item
     * @return \StructType\Supplier_Invoice_System_Validation_ConfigurationType
     */
    public function addToSupplier_Invoice_System_Validation_Configuration_Data(\StructType\Supplier_Invoice_Validation_Configuration_DataType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\Supplier_Invoice_Validation_Configuration_DataType) {
            throw new \InvalidArgumentException(sprintf('The Supplier_Invoice_System_Validation_Configuration_Data property can only contain items of type \StructType\Supplier_Invoice_Validation_Configuration_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->Supplier_Invoice_System_Validation_Configuration_Data[] = $item;
        return $this;
    }
}
