LdapTools\Hydrator\ArrayHydrator::validateAttributesToLdap PHP Method

validateAttributesToLdap() protected method

Checks to make sure all required attributes are present.
protected validateAttributesToLdap ( array $attributes )
$attributes array
    protected function validateAttributesToLdap(array $attributes)
    {
        if (!$this->schema) {
            return;
        }
        $missing = [];
        foreach ($this->schema->getRequiredAttributes() as $attribute) {
            if (!array_key_exists(MBString::strtolower($attribute), MBString::array_change_key_case($attributes))) {
                $missing[] = $attribute;
            }
        }
        if (!empty($missing)) {
            throw new LogicException(sprintf('The following required attributes are missing: %s', implode(', ', $missing)));
        }
    }