public function setCardinality($cardinality)
    {
        if (in_array($cardinality, Cardinality::asArray())) {
            $this->cardinality = $cardinality;
        } else {
            $msg = "The cardinality must be a value from the Cardinality enumeration.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setCardinality($cardinality)
    {
        if (in_array($cardinality, Cardinality::asArray())) {
            $this->cardinality = $cardinality;
        } else {
            $msg = "The cardinality must be a value from the Cardinality enumeration.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setCardinality ( $ cardinality ) { if ( in_array ( $ cardinality , Cardinality :: asArray ( ) ) ) { $ this -> cardinality = $ cardinality ; } else { $ msg = "The cardinality must be a value from the Cardinality enumeration." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the cardinality of the variable.

@param int $cardinality A value from the Cardinality enumeration.
@throws \InvalidArgumentException If $cardinality is not a value from the Cardinality enumeration.
Set the cardinality of the variable .