<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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