Class yii\mongodb\validators\MongoDateValidator
Inheritance | yii\mongodb\validators\MongoDateValidator » yii\validators\DateValidator |
---|---|
Available since version | 2.0.4 |
MongoDateValidator is an enhanced version of \yii\validators\DateValidator, which supports \MongoDate values.
Usage example:
class Customer extends yii\mongodb\ActiveRecord
{
...
public function rules()
{
return [
['date', 'yii\mongodb\validators\MongoDateValidator', 'format' => 'MM/dd/yyyy']
];
}
}
See also \yii\validators\DateValidator.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$mongoDateAttribute | string | The name of the attribute to receive the parsing result as \MongoDate instance. | yii\mongodb\validators\MongoDateValidator |
Public Methods
Method | Description | Defined By |
---|---|---|
validateAttribute() | yii\mongodb\validators\MongoDateValidator |
Protected Methods
Method | Description | Defined By |
---|---|---|
parseDateValue() | yii\mongodb\validators\MongoDateValidator |
Property Details
The name of the attribute to receive the parsing result as \MongoDate instance. When this property is not null and the validation is successful, the named attribute will receive the parsing result as \MongoDate instance.
This can be the same attribute as the one being validated. If this is the case, the original value will be overwritten with the value after successful validation.
Method Details
protected void parseDateValue ( $value ) | ||
$value |
public void validateAttribute ( $model, $attribute ) | ||
$model | ||
$attribute |