LdapTools\Object\LdapObject::toArray PHP Method

toArray() public method

The array representation of the LDAP object.
public toArray ( ) : array
return array
    public function toArray()
    {
        return $this->attributes;
    }

Usage Example

 /**
  * Temporary BC method for LdapObject construction.
  * 
  * @todo remove this at some point. This is to check for instances where the class/category was in the constructor.
  * @param LdapObject $ldapObject
  * @return array
  */
 protected function getParentArgs(LdapObject $ldapObject)
 {
     $constructor = (new \ReflectionClass(get_parent_class()))->getConstructor();
     if ($constructor->getNumberOfParameters() == 2) {
         $args = [$ldapObject->toArray(), $ldapObject->getType()];
     } else {
         $args = [$ldapObject->toArray(), [], '', $ldapObject->getType()];
     }
     return $args;
 }