More work on work on adding/removing objectclasses to an entry, still need to automatically remove attrs from removed objectclasses
Some checks failed
Create Docker Image / Build Docker Image (arm64) (push) Has been cancelled
Create Docker Image / Build Docker Image (x86_64) (push) Has been cancelled
Create Docker Image / Final Docker Image Manifest (push) Has been cancelled
Create Docker Image / Test Application (x86_64) (push) Has been cancelled
Some checks failed
Create Docker Image / Build Docker Image (arm64) (push) Has been cancelled
Create Docker Image / Build Docker Image (x86_64) (push) Has been cancelled
Create Docker Image / Final Docker Image Manifest (push) Has been cancelled
Create Docker Image / Test Application (x86_64) (push) Has been cancelled
This commit is contained in:
@@ -33,9 +33,6 @@ class Attribute implements \Countable, \ArrayAccess, \Iterator
|
||||
// Is this attribute the RDN?
|
||||
protected bool $is_rdn = FALSE;
|
||||
|
||||
// Objectclasses that require this attribute
|
||||
protected Collection $required_by;
|
||||
|
||||
// MIN/MAX number of values
|
||||
protected int $min_values_count = 0;
|
||||
protected int $max_values_count = 0;
|
||||
@@ -102,7 +99,6 @@ class Attribute implements \Countable, \ArrayAccess, \Iterator
|
||||
$this->name = $name;
|
||||
$this->values = collect($values);
|
||||
$this->lang_tags = collect();
|
||||
$this->required_by = collect();
|
||||
$this->oldValues = collect($values);
|
||||
|
||||
// No need to load our schema for internal attributes
|
||||
@@ -149,6 +145,10 @@ class Attribute implements \Countable, \ArrayAccess, \Iterator
|
||||
'old_values' => $this->oldValues,
|
||||
// Attribute values
|
||||
'values' => $this->values,
|
||||
// Required by Object Classes
|
||||
'required_by' => $this->schema->required_by_object_classes,
|
||||
// Used in Object Classes
|
||||
'used_in' => $this->schema->used_in_object_classes,
|
||||
|
||||
default => throw new \Exception('Unknown key:' . $key),
|
||||
};
|
||||
@@ -296,19 +296,6 @@ class Attribute implements \Countable, \ArrayAccess, \Iterator
|
||||
return Arr::get($this->values,$key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the objectclasses that require this attribute
|
||||
*
|
||||
* @param Collection $oc
|
||||
* @return Collection
|
||||
*/
|
||||
public function required_by(Collection $oc): Collection
|
||||
{
|
||||
return $this->required_by = ($this->schema
|
||||
? $oc->intersect($this->schema->required_by_object_classes)
|
||||
: collect());
|
||||
}
|
||||
|
||||
/**
|
||||
* If this attribute has RFC3866 Language Tags, this will enable those values to be captured
|
||||
*
|
||||
|
@@ -549,17 +549,6 @@ final class AttributeType extends Base {
|
||||
$this->aliases->forget($x);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a list of object classes, determine if this is a required attribute
|
||||
*
|
||||
* @param Collection $oc List of objectclasses to compare.
|
||||
* @return Collection
|
||||
*/
|
||||
public function required_by(Collection $oc): Collection
|
||||
{
|
||||
return $oc->diff($this->required_by_object_classes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets this attribute's list of aliases.
|
||||
*
|
||||
|
Reference in New Issue
Block a user