<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Crm.ClientEnrollmentWithSchemeType StructType
 * @subpackage Structs
 */
class Crm_ClientEnrollmentWithSchemeType extends Crm_ClientEnrollment
{
    /**
     * The ClientEnrollmentSchemeType
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $ClientEnrollmentSchemeType;
    /**
     * Constructor method for Crm.ClientEnrollmentWithSchemeType
     * @uses Crm_ClientEnrollmentWithSchemeType::setClientEnrollmentSchemeType()
     * @param string $clientEnrollmentSchemeType
     */
    public function __construct($clientEnrollmentSchemeType = null)
    {
        $this
            ->setClientEnrollmentSchemeType($clientEnrollmentSchemeType);
    }
    /**
     * Get ClientEnrollmentSchemeType 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 string|null
     */
    public function getClientEnrollmentSchemeType()
    {
        return isset($this->ClientEnrollmentSchemeType) ? $this->ClientEnrollmentSchemeType : null;
    }
    /**
     * Set ClientEnrollmentSchemeType 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
     * @uses \patest\EnumType\EnrollmentSchemeType::valueIsValid()
     * @uses \patest\EnumType\EnrollmentSchemeType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $clientEnrollmentSchemeType
     * @return \patest\StructType\Crm_ClientEnrollmentWithSchemeType
     */
    public function setClientEnrollmentSchemeType($clientEnrollmentSchemeType = null)
    {
        // validation for constraint: enumeration
        if (!\patest\EnumType\EnrollmentSchemeType::valueIsValid($clientEnrollmentSchemeType)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \patest\EnumType\EnrollmentSchemeType', is_array($clientEnrollmentSchemeType) ? implode(', ', $clientEnrollmentSchemeType) : var_export($clientEnrollmentSchemeType, true), implode(', ', \patest\EnumType\EnrollmentSchemeType::getValidValues())), __LINE__);
        }
        if (is_null($clientEnrollmentSchemeType) || (is_array($clientEnrollmentSchemeType) && empty($clientEnrollmentSchemeType))) {
            unset($this->ClientEnrollmentSchemeType);
        } else {
            $this->ClientEnrollmentSchemeType = $clientEnrollmentSchemeType;
        }
        return $this;
    }
}
