LdapTools\BatchModify\BatchCollection::getBatchArray PHP Метод

getBatchArray() публичный Метод

Get an array that represents the array form of each batch action to be sent to LDAP.
public getBatchArray ( ) : array
Результат array
    public function getBatchArray()
    {
        $batchEntry = [];
        foreach ($this->batches as $batch) {
            $batchEntry[] = $batch->toArray();
        }
        return $batchEntry;
    }

Usage Example

 function it_should_return_the_arguments_for_the_ldap_function_in_the_correct_order()
 {
     $batch = new BatchCollection();
     $batch->add(new Batch(Batch::TYPE['ADD'], 'foo', 'bar'));
     $args = ['cn=foo,dc=example,dc=local', $batch->getBatchArray()];
     $this->setDn($args[0]);
     $this->setBatchCollection($batch);
     $this->getArguments()->shouldBeEqualTo($args);
 }