LdapTools\Utilities\ConverterUtilitiesTrait::modifyMultivaluedAttribute PHP Метод

modifyMultivaluedAttribute() защищенный Метод

Modifies a multivalued attribute array based off the original values, the new values, and the modification type.
protected modifyMultivaluedAttribute ( array $values, array $newValues ) : array
$values array
$newValues array
Результат array
    protected function modifyMultivaluedAttribute(array $values, array $newValues)
    {
        if ($this->getOperationType() == AttributeConverterInterface::TYPE_CREATE || $this->getBatch() && $this->getBatch()->isTypeAdd()) {
            $values = array_merge($values, $newValues);
        } elseif ($this->getBatch() && $this->getBatch()->isTypeReplace()) {
            $values = $newValues;
        } elseif ($this->getBatch() && $this->getBatch()->isTypeRemove()) {
            $values = array_diff($values, $newValues);
        }
        return $values;
    }