Change Views Handler for entity schema field I want to have a numeric value in my db treated as boolean by drupal.

the field is defined in the hook_schema like this

    'myfield'  =&gt; array(
    'type' =&gt; 'int',
    'unsigned' =&gt; TRUE,
    'not null' =&gt; FALSE,
    'default' =&gt; NULL,
    'description' =&gt; "a field",


So Drupal Views module rightfully detects and displays it as a number.
However i want it to be a Boolean, so in my hook_entity_info i have

'views controller class' =&gt; 'StrutturaViewsController',


and then

class StrutturaViewsController extends EntityDefaultViewsController {

  public function views_data() {
    $data = parent::views_data();

    $data['struttura']['myfield']['field']['handler'] = 'views_handler_field_boolean';

    return $data;
  }
}


'struttura' is the name of the entity that i created, and the name of the table with the 'myfield' coloumn

My problem is that Drupal is still treating the value as numeric.

Am i missing something?
Sure. Adding a new answer to clarify.

To my knowledge (and by that i mean my "very limited Drupal Knowledge") there are 2 ways of mapping the information between schemas and Druapl handlers: by using a custom view controller as i tried to do in the first post, and by implementing the hook_entity_property_info_(). I still don't know why the former approach didn't work but the solution for me was to go with the latter. That is, i had to write 

'myfield' =&gt; array(
  'type'  =&gt; 'boolean',
  'label' =&gt; t('clever label'),
  'description' =&gt; t('clever description'),

  // Map here the field from hook_schema().
  'schema field' =&gt; 'insert_name_of_schema_field_here',
),


Mind that you will have to map EVERY AND EACH of your fields in the schema once you start with this approach.

I also noticed that sometimes doing stuff (like changing ajax config) on the view rendering my entity seems to break the mappings, and i have to clear all caches to bring back my settings.

You can find more information Here