<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for VendorPref StructType
 * @package Dg
 * @subpackage Structs
 */
class DgVendorPref extends DgCompanyNamePrefType
{
    /**
     * The _
     * @var \dgsoft\StructType\DgCompanyNamePrefType
     */
    public $_;
    /**
     * The AllianceAllowedInd
     * @var bool
     */
    public $AllianceAllowedInd;
    /**
     * The LoyaltyAllowedInd
     * @var bool
     */
    public $LoyaltyAllowedInd;
    /**
     * Constructor method for VendorPref
     * @uses DgVendorPref::set_()
     * @uses DgVendorPref::setAllianceAllowedInd()
     * @uses DgVendorPref::setLoyaltyAllowedInd()
     * @param \dgsoft\StructType\DgCompanyNamePrefType $_
     * @param bool $allianceAllowedInd
     * @param bool $loyaltyAllowedInd
     */
    public function __construct(\dgsoft\StructType\DgCompanyNamePrefType $_ = null, $allianceAllowedInd = null, $loyaltyAllowedInd = null)
    {
        $this
            ->set_($_)
            ->setAllianceAllowedInd($allianceAllowedInd)
            ->setLoyaltyAllowedInd($loyaltyAllowedInd);
    }
    /**
     * Get _ value
     * @return \dgsoft\StructType\DgCompanyNamePrefType|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param \dgsoft\StructType\DgCompanyNamePrefType $_
     * @return \dgsoft\StructType\DgVendorPref
     */
    public function set_(\dgsoft\StructType\DgCompanyNamePrefType $_ = null)
    {
        $this->_ = $_;
        return $this;
    }
    /**
     * Get AllianceAllowedInd value
     * @return bool|null
     */
    public function getAllianceAllowedInd()
    {
        return $this->AllianceAllowedInd;
    }
    /**
     * Set AllianceAllowedInd value
     * @param bool $allianceAllowedInd
     * @return \dgsoft\StructType\DgVendorPref
     */
    public function setAllianceAllowedInd($allianceAllowedInd = null)
    {
        // validation for constraint: boolean
        if (!is_null($allianceAllowedInd) && !is_bool($allianceAllowedInd)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($allianceAllowedInd)), __LINE__);
        }
        $this->AllianceAllowedInd = $allianceAllowedInd;
        return $this;
    }
    /**
     * Get LoyaltyAllowedInd value
     * @return bool|null
     */
    public function getLoyaltyAllowedInd()
    {
        return $this->LoyaltyAllowedInd;
    }
    /**
     * Set LoyaltyAllowedInd value
     * @param bool $loyaltyAllowedInd
     * @return \dgsoft\StructType\DgVendorPref
     */
    public function setLoyaltyAllowedInd($loyaltyAllowedInd = null)
    {
        // validation for constraint: boolean
        if (!is_null($loyaltyAllowedInd) && !is_bool($loyaltyAllowedInd)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($loyaltyAllowedInd)), __LINE__);
        }
        $this->LoyaltyAllowedInd = $loyaltyAllowedInd;
        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\DgVendorPref
     */
    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__;
    }
}
