<?php
use \WsdlToPhp\PackageBase\AbstractStructArrayBase;

/**
 * This class stands for ArrayOfDiagnosticResult ArrayType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:ArrayOfDiagnosticResult
 * @subpackage Arrays
 */
class ArrayOfDiagnosticResult extends AbstractStructArrayBase
{
    /**
     * The DiagnosticResult
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * - nillable: true
     * @var DiagnosticResult[]
     */
    public $DiagnosticResult;
    /**
     * Constructor method for ArrayOfDiagnosticResult
     * @uses ArrayOfDiagnosticResult::setDiagnosticResult()
     * @param DiagnosticResult[] $diagnosticResult
     */
    public function __construct(array $diagnosticResult = array())
    {
        $this
            ->setDiagnosticResult($diagnosticResult);
    }
    /**
     * Get DiagnosticResult 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 DiagnosticResult[]|null
     */
    public function getDiagnosticResult()
    {
        return isset($this->DiagnosticResult) ? $this->DiagnosticResult : null;
    }
    /**
     * Set DiagnosticResult 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 DiagnosticResult[] $diagnosticResult
     * @return ArrayOfDiagnosticResult
     */
    public function setDiagnosticResult(array $diagnosticResult = array())
    {
        if (is_null($diagnosticResult) || (is_array($diagnosticResult) && empty($diagnosticResult))) {
            unset($this->DiagnosticResult);
        } else {
            $this->DiagnosticResult = $diagnosticResult;
        }
        return $this;
    }
    /**
     * Add item to DiagnosticResult value
     * @throws \InvalidArgumentException
     * @param DiagnosticResult $item
     * @return ArrayOfDiagnosticResult
     */
    public function addToDiagnosticResult(DiagnosticResult $item)
    {
        $this->DiagnosticResult[] = $item;
        return $this;
    }
    /**
     * Returns the current element
     * @see AbstractStructArrayBase::current()
     * @return DiagnosticResult|null
     */
    public function current()
    {
        return parent::current();
    }
    /**
     * Returns the indexed element
     * @see AbstractStructArrayBase::item()
     * @param int $index
     * @return DiagnosticResult|null
     */
    public function item($index)
    {
        return parent::item($index);
    }
    /**
     * Returns the first element
     * @see AbstractStructArrayBase::first()
     * @return DiagnosticResult|null
     */
    public function first()
    {
        return parent::first();
    }
    /**
     * Returns the last element
     * @see AbstractStructArrayBase::last()
     * @return DiagnosticResult|null
     */
    public function last()
    {
        return parent::last();
    }
    /**
     * Returns the element at the offset
     * @see AbstractStructArrayBase::offsetGet()
     * @param int $offset
     * @return DiagnosticResult|null
     */
    public function offsetGet($offset)
    {
        return parent::offsetGet($offset);
    }
    /**
     * Returns the attribute name
     * @see AbstractStructArrayBase::getAttributeName()
     * @return string DiagnosticResult
     */
    public function getAttributeName()
    {
        return 'DiagnosticResult';
    }
}
