Store our DN and objectclasses in Attribute::class entries, so that we can dynamically calculate is_rdn and required objects (to be implemented)

This commit is contained in:
2025-03-14 16:54:10 +11:00
parent d3fc9c135f
commit d326d3c308
7 changed files with 82 additions and 43 deletions

View File

@@ -49,15 +49,17 @@ class Factory
/**
* Create the new Object for an attribute
*
* @param string $dn
* @param string $attribute
* @param array $values
* @param array $oc
* @return Attribute
*/
public static function create(string $attribute,array $values): Attribute
public static function create(string $dn,string $attribute,array $values,array $oc=[]): Attribute
{
$class = Arr::get(self::map,strtolower($attribute),Attribute::class);
Log::debug(sprintf('%s:Creating LDAP Attribute [%s] as [%s]',static::LOGKEY,$attribute,$class));
return new $class($attribute,$values);
return new $class($dn,$attribute,$values,$oc);
}
}