Work out which attributes are available to a DN

This commit is contained in:
2023-09-02 20:28:04 +10:00
parent 9d1d969113
commit 6d900d0964
4 changed files with 87 additions and 31 deletions

View File

@@ -120,6 +120,8 @@ class Attribute
public function __get(string $key): mixed
{
return match ($key) {
// List all the attributes
'attributes' => $this->attributes(),
// Can this attribute have more values
'can_addvalues' => $this->schema && (! $this->schema->is_single_value) && ((! $this->max_values_count) || ($this->values->count() < $this->max_values_count)),
// Schema attribute description
@@ -143,6 +145,11 @@ class Attribute
};
}
public function __toString(): string
{
return $this->__get('name');
}
/**
* Return the hints about this attribute, ie: RDN, Required, etc
*