LdapTools\Utilities\ConverterUtilitiesTrait::setDefaultLastValue PHP Method

setDefaultLastValue() protected method

Specify an attribute to query to set as the last value. If that is not found, have it set the value specified by whatever you pass to $default.
protected setDefaultLastValue ( string $attribute, mixed $default )
$attribute string
$default mixed
    protected function setDefaultLastValue($attribute, $default)
    {
        if (empty($this->getLastValue()) && $this->getOperationType() == AttributeConverterInterface::TYPE_MODIFY) {
            $original = $this->getCurrentLdapAttributeValue($attribute);
            $this->setLastValue(is_null($original) ? $default : $original);
        } elseif (empty($this->getLastValue()) && $this->getOperationType() == AttributeConverterInterface::TYPE_CREATE) {
            $this->setLastValue($default);
        }
    }