<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for PakietRealizacjiReceptMT StructType
 * Meta information extracted from the WSDL
 * - documentation: Pakiet realizacji recept.
 * @subpackage Structs
 */
class PakietRealizacjiReceptMT extends AbstractStructBase
{
    /**
     * The realizacje
     * Meta information extracted from the WSDL
     * - choice: realizacje
     * - choiceMaxOccurs: 1
     * - choiceMinOccurs: 1
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var RealizacjeReceptWPakiecieMT
     */
    public $realizacje;
    /**
     * Constructor method for PakietRealizacjiReceptMT
     * @uses PakietRealizacjiReceptMT::setRealizacje()
     * @param RealizacjeReceptWPakiecieMT $realizacje
     */
    public function __construct(RealizacjeReceptWPakiecieMT $realizacje = null)
    {
        $this
            ->setRealizacje($realizacje);
    }
    /**
     * Get realizacje value
     * @return RealizacjeReceptWPakiecieMT
     */
    public function getRealizacje()
    {
        return isset($this->realizacje) ? $this->realizacje : null;
    }
    /**
     * This method is responsible for validating the value passed to the setRealizacje method
     * This method is willingly generated in order to preserve the one-line inline validation within the setRealizacje method
     * This has to validate that the property which is being set is the only one among the given choices
     * @param mixed $value
     * @return string A non-empty message if the values does not match the validation rules
     */
    public function validateRealizacjeForChoiceConstraintsFromSetRealizacje($value)
    {
        $message = '';
        if (is_null($value)) {
            return $message;
        }
        $properties = [
        ];
        try {
            foreach ($properties as $property) {
                if (isset($this->{$property})) {
                    throw new \InvalidArgumentException(sprintf('The property realizacje can\'t be set as the property %s is already set. Only one property must be set among these properties: realizacje, %s.', $property, implode(', ', $properties)), __LINE__);
                }
            }
        } catch (\InvalidArgumentException $e) {
            $message = $e->getMessage();
        }
        return $message;
    }
    /**
     * Set realizacje value
     * This property belongs to a choice that allows only one property to exist. It is
     * therefore removable from the request, consequently if the value assigned to this
     * property is null, the property is removed from this object
     * @throws \InvalidArgumentException
     * @param RealizacjeReceptWPakiecieMT $realizacje
     * @return PakietRealizacjiReceptMT
     */
    public function setRealizacje(RealizacjeReceptWPakiecieMT $realizacje = null)
    {
        // validation for constraint: choice(realizacje)
        if ('' !== ($realizacjeChoiceErrorMessage = self::validateRealizacjeForChoiceConstraintsFromSetRealizacje($realizacje))) {
            throw new \InvalidArgumentException($realizacjeChoiceErrorMessage, __LINE__);
        }
        if (is_null($realizacje) || (is_array($realizacje) && empty($realizacje))) {
            unset($this->realizacje);
        } else {
            $this->realizacje = $realizacje;
        }
        return $this;
    }
}
