public static function required($modelType, $propertyName, $errorMessage = null) {
        if (!self::canAnnotate($modelType)) {
            return;
        }

        if (empty($propertyName)) {
            throw new \Exception('$propertyName must not be empty.');
        }

        self::makeDataAnnotation($propertyName);

        self::$annotations[$propertyName]->required = array($errorMessage);
    }
public static function required($modelType, $propertyName, $errorMessage = null) {
        if (!self::canAnnotate($modelType)) {
            return;
        }

        if (empty($propertyName)) {
            throw new \Exception('$propertyName must not be empty.');
        }

        self::makeDataAnnotation($propertyName);

        self::$annotations[$propertyName]->required = array($errorMessage);
    }
public static function required ( $ modelType , $ propertyName , $ errorMessage = null ) { if ( ! self :: canAnnotate ( $ modelType ) ) { return ; } if ( empty ( $ propertyName ) ) { throw new \ Exception ( '$propertyName must not be empty.' ) ; } self :: makeDataAnnotation ( $ propertyName ) ; self :: $ annotations [ $ propertyName ] -> required = array ( $ errorMessage ) ; }
Marks the specified property with the attribute "requred"
and it is expected that the property value must be specified.

@param string|object $modelType The name type of model.
@param string $propertyName The property name.
@param string $errorMessage The error message.

@return void
Marks the specified property with the attribute requred and it is expected that the property value must be specified .