GP_Translation::restrict_fields PHP Method

restrict_fields() public method

Sets restriction rules for fields.
Since: 1.0.0
public restrict_fields ( GP_Validation_Rules $rules )
$rules GP_Validation_Rules The validation rules instance.
    public function restrict_fields($rules)
    {
        $rules->translation_0_should_not_be('empty_string');
        $rules->translation_1_should_not_be('empty_string');
        $rules->translation_2_should_not_be('empty_string');
        $rules->translation_3_should_not_be('empty_string');
        $rules->translation_4_should_not_be('empty_string');
        $rules->translation_5_should_not_be('empty_string');
        $rules->status_should_not_be('empty');
        $rules->original_id_should_be('positive_int');
        $rules->translation_set_id_should_be('positive_int');
        $rules->user_id_should_be('positive_int');
        $rules->user_id_last_modified_should_not_be('empty_string');
    }