Adldap\Objects\BatchModification::setValues PHP Method

setValues() public method

Sets the values of the modification.
public setValues ( array $values = [] ) : BatchModification
$values array
return BatchModification
    public function setValues(array $values = [])
    {
        $this->values = array_map(function ($value) {
            // We need to make sure all values given to a batch modification are
            // strings, otherwise we'll receive an LDAP exception when
            // we try to process the modification.
            return (string) $value;
        }, $values);
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Removes an entry from the current group.
  *
  * @param string|Entry $entry
  *
  * @return bool
  */
 public function removeMember($entry)
 {
     if ($entry instanceof Entry) {
         $entry = $entry->getDn();
     }
     $modification = new BatchModification();
     $modification->setAttribute($this->schema->member());
     $modification->setType(LDAP_MODIFY_BATCH_REMOVE);
     $modification->setValues([$entry]);
     $this->addModification($modification);
     return $this->save();
 }
All Usage Examples Of Adldap\Objects\BatchModification::setValues