Hello, I've been using TINYINT(1) as boolean for a while now. I came across a problem when I tried to use models metadata to automate resultset representation. That's what I'm trying to achieve:
{%- for key, fieldName in columnNames -%}
<td>
{% if columnTypes[fieldName] === constant("Phalcon\Db\Column::TYPE_DATETIME") %}
{{date('d.m.Y h:i',strtotime(row.readAttribute(fieldName)))}}
/* I need some way to distinguish TINYINT type of column to view it appropriately
{% elseif columnTypes[fieldName] === constant("Phalcon\Db\Column::TYPE_TINYINT") %}
put some graphics for 'yes' 'no' value like 'V' 'X'
*/
{% else %}
{{ row.readAttribute(fieldName) }}
{% endif %}
</td>
{%- endfor -%}
I understand that Phalcon cast all mysql ?INT() datatypes to integer (because php have only integer). And I understand that I can manually set all metadata for my models but I have a lot of them. And I don't want to redefine mysql columns also(e.g. change TINYINT() for BOOLEAN/BYTE) because tinyint is more consistent. Is there any way to tell phalcon just about few tinyint columns without defining a bunch of metadatas manyally?