src/Objects/AbstractObject.php
public function validateRequired($only = [])
    {
        if (count($only) > 0) {
            return $this->validateSpecific($only);
        }

        /*
         * Go through each required attribute
         * and make sure they're not null
         */
        foreach ($this->required as $required) {
            if ($this->getAttribute($required) === null) {
                throw new AdldapException(sprintf($this->messages['required'], $required));
            }
        }

        return true;
    }
public function validateRequired($only = [])
    {
        if (count($only) > 0) {
            return $this->validateSpecific($only);
        }

        /*
         * Go through each required attribute
         * and make sure they're not null
         */
        foreach ($this->required as $required) {
            if ($this->getAttribute($required) === null) {
                throw new AdldapException(sprintf($this->messages['required'], $required));
            }
        }

        return true;
    }
public function validateRequired ( $ only = [ ] ) { if ( count ( $ only ) > 0 ) { return $ this -> validateSpecific ( $ only ) ; } /*
         * Go through each required attribute
         * and make sure they're not null
         */ foreach ( $ this -> required as $ required ) { if ( $ this -> getAttribute ( $ required ) === null ) { throw new AdldapException ( sprintf ( $ this -> messages [ 'required' ] , $ required ) ) ; } } return true ; }
Validates the required attributes for preventing null keys.

If an array is provided, then the specified required attributes
are only validated.

@param array $only

@return bool

@throws AdldapException
Validates the required attributes for preventing null keys .