/** * Constructor * * @param AttributeType $type Attribute type * @param AttributeValue ...$values Attribute values */ public function __construct(AttributeType $type, AttributeValue ...$values) { // check that attribute values have correct oid array_walk($values, function (AttributeValue $value) use($type) { if ($value->oid() != $type->oid()) { throw new \LogicException("Attribute OID mismatch."); } }); $this->_type = $type; $this->_values = $values; }
/** * Get OID of the attribute. * * @return string */ public function oid() { return $this->_type->oid(); }