<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Amenity StructType
 * @package Dg
 * @subpackage Structs
 */
class DgAmenity extends DgRoomAmenityPrefType
{
    /**
     * The _
     * @var \dgsoft\StructType\DgRoomAmenityPrefType
     */
    public $_;
    /**
     * The PropertyAmenityType
     * @var string
     */
    public $PropertyAmenityType;
    /**
     * Constructor method for Amenity
     * @uses DgAmenity::set_()
     * @uses DgAmenity::setPropertyAmenityType()
     * @param \dgsoft\StructType\DgRoomAmenityPrefType $_
     * @param string $propertyAmenityType
     */
    public function __construct(\dgsoft\StructType\DgRoomAmenityPrefType $_ = null, $propertyAmenityType = null)
    {
        $this
            ->set_($_)
            ->setPropertyAmenityType($propertyAmenityType);
    }
    /**
     * Get _ value
     * @return \dgsoft\StructType\DgRoomAmenityPrefType|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param \dgsoft\StructType\DgRoomAmenityPrefType $_
     * @return \dgsoft\StructType\DgAmenity
     */
    public function set_(\dgsoft\StructType\DgRoomAmenityPrefType $_ = null)
    {
        $this->_ = $_;
        return $this;
    }
    /**
     * Get PropertyAmenityType value
     * @return string|null
     */
    public function getPropertyAmenityType()
    {
        return $this->PropertyAmenityType;
    }
    /**
     * Set PropertyAmenityType value
     * @param string $propertyAmenityType
     * @return \dgsoft\StructType\DgAmenity
     */
    public function setPropertyAmenityType($propertyAmenityType = null)
    {
        // validation for constraint: string
        if (!is_null($propertyAmenityType) && !is_string($propertyAmenityType)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($propertyAmenityType)), __LINE__);
        }
        $this->PropertyAmenityType = $propertyAmenityType;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \dgsoft\StructType\DgAmenity
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
