protected function fieldTypeToRules($field, AbstractData $data, Validator $validator)
    {
        $setItems     = $this->definition->getField($field, 'items', []);
        $rulesMapping = [
            'boolean' => ['boolean'],
            'float' => ['floating'],
            'integer' => ['integer'],
            'date' => ['dateTime', 'Y-m-d'],
            'datetime' => ['or', $validator, ['dateTime', 'Y-m-d H:i'], ['dateTime', 'Y-m-d H:i:s']],
            'set' => array_merge(['inSet'], $setItems),
            'reference' => ['reference', $data, $field],
            'many' => ['many', $data, $field]
        ];
        $type         = $this->definition->getType($field);
        $rules        = [];
        if (array_key_exists($type, $rulesMapping)) {
            $rules[] = $rulesMapping[$type];
        }
        return $rules;
    }