<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for lineAppearanceAssociationForPresences StructType
 * Meta informations extracted from the WSDL
 * - documentation: Applicable for Controlled Devices | Applicable for Controlled Devices
 * @subpackage Structs
 */
class LineAppearanceAssociationForPresences extends AbstractStructBase
{
    /**
     * The lineAppearanceAssociationForPresence
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var XLineAppearanceAssociationForPresence[]
     */
    public $lineAppearanceAssociationForPresence;
    /**
     * Constructor method for lineAppearanceAssociationForPresences
     * @uses LineAppearanceAssociationForPresences::setLineAppearanceAssociationForPresence()
     * @param XLineAppearanceAssociationForPresence[] $lineAppearanceAssociationForPresence
     */
    public function __construct(array $lineAppearanceAssociationForPresence = array())
    {
        $this
            ->setLineAppearanceAssociationForPresence($lineAppearanceAssociationForPresence);
    }
    /**
     * Get lineAppearanceAssociationForPresence value
     * @return XLineAppearanceAssociationForPresence[]|null
     */
    public function getLineAppearanceAssociationForPresence()
    {
        return $this->lineAppearanceAssociationForPresence;
    }
    /**
     * Set lineAppearanceAssociationForPresence value
     * @throws \InvalidArgumentException
     * @param XLineAppearanceAssociationForPresence[] $lineAppearanceAssociationForPresence
     * @return LineAppearanceAssociationForPresences
     */
    public function setLineAppearanceAssociationForPresence(array $lineAppearanceAssociationForPresence = array())
    {
        foreach ($lineAppearanceAssociationForPresence as $lineAppearanceAssociationForPresencesLineAppearanceAssociationForPresenceItem) {
            // validation for constraint: itemType
            if (!$lineAppearanceAssociationForPresencesLineAppearanceAssociationForPresenceItem instanceof XLineAppearanceAssociationForPresence) {
                throw new \InvalidArgumentException(sprintf('The lineAppearanceAssociationForPresence property can only contain items of XLineAppearanceAssociationForPresence, "%s" given', is_object($lineAppearanceAssociationForPresencesLineAppearanceAssociationForPresenceItem) ? get_class($lineAppearanceAssociationForPresencesLineAppearanceAssociationForPresenceItem) : gettype($lineAppearanceAssociationForPresencesLineAppearanceAssociationForPresenceItem)), __LINE__);
            }
        }
        $this->lineAppearanceAssociationForPresence = $lineAppearanceAssociationForPresence;
        return $this;
    }
    /**
     * Add item to lineAppearanceAssociationForPresence value
     * @throws \InvalidArgumentException
     * @param XLineAppearanceAssociationForPresence $item
     * @return LineAppearanceAssociationForPresences
     */
    public function addToLineAppearanceAssociationForPresence(XLineAppearanceAssociationForPresence $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XLineAppearanceAssociationForPresence) {
            throw new \InvalidArgumentException(sprintf('The lineAppearanceAssociationForPresence property can only contain items of XLineAppearanceAssociationForPresence, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->lineAppearanceAssociationForPresence[] = $item;
        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 LineAppearanceAssociationForPresences
     */
    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__;
    }
}
