LdapTools\Ldif\Entry\LdifEntryTrait::addControlsToString PHP Method

addControlsToString() protected method

Add any LDAP controls to the specified LDIF.
protected addControlsToString ( string $ldif ) : string
$ldif string
return string
    protected function addControlsToString($ldif)
    {
        foreach ($this->controls as $control) {
            $value = $control->getOid() . ' ' . $control->getCriticality();
            if (!is_null($control->getValue())) {
                $value .= ' ' . $control->getValue();
            }
            $ldif .= $this->getLdifLine(Ldif::DIRECTIVE_CONTROL, $value);
        }
        return $ldif;
    }