protected function verifyRequiredData()
    {
        $errors = array(
            'missing' => array(),
            'invalid' => array()
        );
        $error = FALSE;
        if (!empty($this->properties['required'])) {
            foreach ($this->properties['required'] as $property => $type) {
                if (!isset($this->data[$property])) {
                    $errors['missing'][] = $property;
                    $error = TRUE;
                    continue;
                }
                if ($type !== NULL && gettype($this->data[$property]) !== $type) {
                    $errors['invalid'][] = $property;
                    $error = TRUE;
                }
            }
        }
        if ($error){
            $errorMsg = '';
            if (!empty($errors['missing'])){
                $errorMsg .= "Missing [".implode(",",$errors['missing']). "] ";
            }
            if (!empty($errors['invalid'])){
                $errorMsg .= "Invalid [".implode(",",$errors['invalid'])."]";
            }
            throw new InvalidData($errorMsg);
        }
        return $error;
    }
protected function verifyRequiredData()
    {
        $errors = array(
            'missing' => array(),
            'invalid' => array()
        );
        $error = FALSE;
        if (!empty($this->properties['required'])) {
            foreach ($this->properties['required'] as $property => $type) {
                if (!isset($this->data[$property])) {
                    $errors['missing'][] = $property;
                    $error = TRUE;
                    continue;
                }
                if ($type !== NULL && gettype($this->data[$property]) !== $type) {
                    $errors['invalid'][] = $property;
                    $error = TRUE;
                }
            }
        }
        if ($error){
            $errorMsg = '';
            if (!empty($errors['missing'])){
                $errorMsg .= "Missing [".implode(",",$errors['missing']). "] ";
            }
            if (!empty($errors['invalid'])){
                $errorMsg .= "Invalid [".implode(",",$errors['invalid'])."]";
            }
            throw new InvalidData($errorMsg);
        }
        return $error;
    }
protected function verifyRequiredData ( ) { $ errors = array ( 'missing' => array ( ) , 'invalid' => array ( ) ) ; $ error = FALSE ; if ( ! empty ( $ this -> properties [ 'required' ] ) ) { foreach ( $ this -> properties [ 'required' ] as $ property => $ type ) { if ( ! isset ( $ this -> data [ $ property ] ) ) { $ errors [ 'missing' ] [ ] = $ property ; $ error = TRUE ; continue ; } if ( $ type !== NULL && gettype ( $ this -> data [ $ property ] ) !== $ type ) { $ errors [ 'invalid' ] [ ] = $ property ; $ error = TRUE ; } } } if ( $ error ) { $ errorMsg = '' ; if ( ! empty ( $ errors [ 'missing' ] ) ) { $ errorMsg .= "Missing [" . implode ( "," , $ errors [ 'missing' ] ) . "] " ; } if ( ! empty ( $ errors [ 'invalid' ] ) ) { $ errorMsg .= "Invalid [" . implode ( "," , $ errors [ 'invalid' ] ) . "]" ; } throw new InvalidData ( $ errorMsg ) ; } return $ error ; }
Validate Required Data for the Endpoint
@return bool
@throws InvalidData
Validate Required Data for the Endpoint