<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for SyncEntitiesFromExternalSourceResponseEx StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:SyncEntitiesFromExternalSourceResponseEx
 * @subpackage Structs
 */
class SyncEntitiesFromExternalSourceResponseEx extends SyncEntitiesFromExternalSourceResponse
{
    /**
     * The HasErrors
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $HasErrors;
    /**
     * The MappingInfo
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfKeyValueOfstringSroSyncInfoWTEG5wMr
     */
    public $MappingInfo;
    /**
     * Constructor method for SyncEntitiesFromExternalSourceResponseEx
     * @uses SyncEntitiesFromExternalSourceResponseEx::setHasErrors()
     * @uses SyncEntitiesFromExternalSourceResponseEx::setMappingInfo()
     * @param bool $hasErrors
     * @param \patest\ArrayType\ArrayOfKeyValueOfstringSroSyncInfoWTEG5wMr $mappingInfo
     */
    public function __construct($hasErrors = null, \patest\ArrayType\ArrayOfKeyValueOfstringSroSyncInfoWTEG5wMr $mappingInfo = null)
    {
        $this
            ->setHasErrors($hasErrors)
            ->setMappingInfo($mappingInfo);
    }
    /**
     * Get HasErrors value
     * @return bool|null
     */
    public function getHasErrors()
    {
        return $this->HasErrors;
    }
    /**
     * Set HasErrors value
     * @param bool $hasErrors
     * @return \patest\StructType\SyncEntitiesFromExternalSourceResponseEx
     */
    public function setHasErrors($hasErrors = null)
    {
        // validation for constraint: boolean
        if (!is_null($hasErrors) && !is_bool($hasErrors)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($hasErrors, true), gettype($hasErrors)), __LINE__);
        }
        $this->HasErrors = $hasErrors;
        return $this;
    }
    /**
     * Get MappingInfo 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\ArrayOfKeyValueOfstringSroSyncInfoWTEG5wMr|null
     */
    public function getMappingInfo()
    {
        return isset($this->MappingInfo) ? $this->MappingInfo : null;
    }
    /**
     * Set MappingInfo 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\ArrayOfKeyValueOfstringSroSyncInfoWTEG5wMr $mappingInfo
     * @return \patest\StructType\SyncEntitiesFromExternalSourceResponseEx
     */
    public function setMappingInfo(\patest\ArrayType\ArrayOfKeyValueOfstringSroSyncInfoWTEG5wMr $mappingInfo = null)
    {
        if (is_null($mappingInfo) || (is_array($mappingInfo) && empty($mappingInfo))) {
            unset($this->MappingInfo);
        } else {
            $this->MappingInfo = $mappingInfo;
        }
        return $this;
    }
}
