Tuesday, April 5, 2011

TinyInt's not converted to Boolean

I have a model with a few tinyint(1) fields. I use this simple find:
$this->Model->find('all'). But the tinyint fields are returned like
this with var_dump:

["enabled"]=>
string(1) "1"

This is the field in the table:

`enabled` tinyint(1) NOT NULL DEFAULT '1',


This is what the docs tell me at http://book.cakephp.org/nl/view/1003/Data-Type-Associations-by-Database
:
A tinyint(1) field is considered a boolean by CakePHP.


What am I doing wrong? Where should I look to fix this?

Thanks!

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: