src/Table.php
public function validationEnabled(Validator $validator) : Validator
    {
        $className = App::shortName(get_class($this), 'Model/Table', 'Table');
        $config = (new ModuleConfig(ConfigType::MIGRATION(), $className))->parse();
        $config = json_encode($config);
        if (false === $config) {
            return $validator;
        }
        $config = json_decode($config, true);
        $factory = new FieldHandlerFactory();

        foreach ($config as $column) {
            $validator = $factory->setValidationRules($this, $column['name'], $validator);
        }

        return $validator;
    }
public function validationEnabled(Validator $validator) : Validator
    {
        $className = App::shortName(get_class($this), 'Model/Table', 'Table');
        $config = (new ModuleConfig(ConfigType::MIGRATION(), $className))->parse();
        $config = json_encode($config);
        if (false === $config) {
            return $validator;
        }
        $config = json_decode($config, true);
        $factory = new FieldHandlerFactory();

        foreach ($config as $column) {
            $validator = $factory->setValidationRules($this, $column['name'], $validator);
        }

        return $validator;
    }
public function validationEnabled ( Validator $ validator ) : Validator { $ className = App :: shortName ( get_class ( $ this ) , 'Model/Table' , 'Table' ) ; $ config = ( new ModuleConfig ( ConfigType :: MIGRATION ( ) , $ className ) ) -> parse ( ) ; $ config = json_encode ( $ config ) ; if ( false === $ config ) { return $ validator ; } $ config = json_decode ( $ config , true ) ; $ factory = new FieldHandlerFactory ( ) ; foreach ( $ config as $ column ) { $ validator = $ factory -> setValidationRules ( $ this , $ column [ 'name' ] , $ validator ) ; } return $ validator ; }
Set Table validation rules.

@param \Cake\Validation\Validator $validator Validator instance
@return \Cake\Validation\Validator
Set Table validation rules .