src/Model/ApiResourceBase.php
protected static function checkNew(array $data)
    {
        $errors = [];
        if ($missing = array_diff(static::getRequired(), array_keys($data))) {
            $errors[] = 'Missing: ' . implode(', ', $missing);
        }
        foreach ($data as $key => $value) {
            $errors += static::checkProperty($key, $value);
        }
        return $errors;
    }
protected static function checkNew(array $data)
    {
        $errors = [];
        if ($missing = array_diff(static::getRequired(), array_keys($data))) {
            $errors[] = 'Missing: ' . implode(', ', $missing);
        }
        foreach ($data as $key => $value) {
            $errors += static::checkProperty($key, $value);
        }
        return $errors;
    }
protected static function checkNew ( array $ data ) { $ errors = [ ] ; if ( $ missing = array_diff ( static :: getRequired ( ) , array_keys ( $ data ) ) ) { $ errors [ ] = 'Missing: ' . implode ( ', ' , $ missing ) ; } foreach ( $ data as $ key => $ value ) { $ errors += static :: checkProperty ( $ key , $ value ) ; } return $ errors ; }
Validate a new resource.

@param array $data

@return string[] An array of validation errors.
Validate a new resource .