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;
    }