<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ResultDataPart StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:ResultDataPart
 * @subpackage Structs
 */
class ResultDataPart extends AbstractStructBase
{
    /**
     * The Records
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfResultRecord
     */
    public $Records;
    /**
     * Constructor method for ResultDataPart
     * @uses ResultDataPart::setRecords()
     * @param \patest\ArrayType\ArrayOfResultRecord $records
     */
    public function __construct(\patest\ArrayType\ArrayOfResultRecord $records = null)
    {
        $this
            ->setRecords($records);
    }
    /**
     * Get Records 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\ArrayOfResultRecord|null
     */
    public function getRecords()
    {
        return isset($this->Records) ? $this->Records : null;
    }
    /**
     * Set Records 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\ArrayOfResultRecord $records
     * @return \patest\StructType\ResultDataPart
     */
    public function setRecords(\patest\ArrayType\ArrayOfResultRecord $records = null)
    {
        if (is_null($records) || (is_array($records) && empty($records))) {
            unset($this->Records);
        } else {
            $this->Records = $records;
        }
        return $this;
    }
}
