<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for TransactionValidationFault StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:TransactionValidationFault
 * @subpackage Structs
 */
class TransactionValidationFault extends BasicFault
{
    /**
     * The FailureReasons
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfTransactionMessageBase
     */
    public $FailureReasons;
    /**
     * Constructor method for TransactionValidationFault
     * @uses TransactionValidationFault::setFailureReasons()
     * @param \patest\ArrayType\ArrayOfTransactionMessageBase $failureReasons
     */
    public function __construct(\patest\ArrayType\ArrayOfTransactionMessageBase $failureReasons = null)
    {
        $this
            ->setFailureReasons($failureReasons);
    }
    /**
     * Get FailureReasons value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return \patest\ArrayType\ArrayOfTransactionMessageBase|null
     */
    public function getFailureReasons()
    {
        return isset($this->FailureReasons) ? $this->FailureReasons : null;
    }
    /**
     * Set FailureReasons value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param \patest\ArrayType\ArrayOfTransactionMessageBase $failureReasons
     * @return \patest\StructType\TransactionValidationFault
     */
    public function setFailureReasons(\patest\ArrayType\ArrayOfTransactionMessageBase $failureReasons = null)
    {
        if (is_null($failureReasons) || (is_array($failureReasons) && empty($failureReasons))) {
            unset($this->FailureReasons);
        } else {
            $this->FailureReasons = $failureReasons;
        }
        return $this;
    }
}
