<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CompanyCardResult StructType
 * @subpackage Structs
 */
class CompanyCardResult extends AbstractStructBase
{
    /**
     * The CardId
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var int
     */
    public $CardId;
    /**
     * The CardName
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $CardName;
    /**
     * Constructor method for CompanyCardResult
     * @uses CompanyCardResult::setCardId()
     * @uses CompanyCardResult::setCardName()
     * @param int $cardId
     * @param string $cardName
     */
    public function __construct($cardId = null, $cardName = null)
    {
        $this
            ->setCardId($cardId)
            ->setCardName($cardName);
    }
    /**
     * Get CardId value
     * @return int
     */
    public function getCardId()
    {
        return $this->CardId;
    }
    /**
     * Set CardId value
     * @param int $cardId
     * @return \StructType\CompanyCardResult
     */
    public function setCardId($cardId = null)
    {
        // validation for constraint: int
        if (!is_null($cardId) && !(is_int($cardId) || ctype_digit($cardId))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($cardId, true), gettype($cardId)), __LINE__);
        }
        $this->CardId = $cardId;
        return $this;
    }
    /**
     * Get CardName value
     * @return string|null
     */
    public function getCardName()
    {
        return $this->CardName;
    }
    /**
     * Set CardName value
     * @param string $cardName
     * @return \StructType\CompanyCardResult
     */
    public function setCardName($cardName = null)
    {
        // validation for constraint: string
        if (!is_null($cardName) && !is_string($cardName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cardName, true), gettype($cardName)), __LINE__);
        }
        $this->CardName = $cardName;
        return $this;
    }
}
