LdapTools\Ldif\Entry\LdifEntryAdd::addAttribute PHP Method

addAttribute() public method

Add an attribute that will be added to the entry going to LDAP.
public addAttribute ( string $attribute, mixed $value )
$attribute string
$value mixed
    public function addAttribute($attribute, $value)
    {
        $value = is_array($value) ? $value : [$value];
        if (!isset($this->attributes[$attribute])) {
            $this->attributes[$attribute] = [];
        }
        foreach ($value as $attrValue) {
            $this->attributes[$attribute][] = $attrValue;
        }
        return $this;
    }