Example #1
0
 public static function asArray()
 {
     $values = Cardinality::asArray();
     $values['SAME'] = self::SAME;
     $values['ANY'] = self::ANY;
     return $values;
 }
Example #2
0
 /**
  * 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.
  */
 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);
     }
 }