/** * Adds writing an attribute to a grouped writing/deletion process. * * Set of values is filtered to exclude all empty strings. If resulting * set is empty whole attribute is deleted. * * @throws protocol_exception * @param attribute $attribute attribute to be adjusted * @param array $values set of values to be assigned to selected attribute * @return node current instance */ public function adjust(attribute $attribute, $values) { if (!is_array($this->adjustment)) { throw new protocol_exception('invalid use of grouped writing', $this->link, $this->getDN()); } $this->adjustment[$attribute->getName()] = array_filter(array_map(function ($a) { return trim($a); }, $values), function ($a) { return $a !== ''; }); return $this; }