Here is a line of code from a list view:
<td style="width:20px;"><?php echo $row->adopted; ?></td>
The field adopted is tinyint, should be a 0 or 1 only. This same line shows correct in laravel, a 0 (zero). However in cakephp using the query builder the field is blank.
I had to modify the code to:
<td style="width:20px;"><?php echo ($row->adopted == 1 ? 1 : 0); ?></td>
to get it to show a 0. Now why in the world is this happening in cakephp 3.x only? Is it something to do with the querybuilder?
It is a test database I use so also in yii2, same line of code show correctly. Exact same database. And yii2 and laravel the querybuilder was used.
I did a quick test using database instead of querybuilder:
$connection = ConnectionManager::get('default'); $query = $connection->execute('SELECT * FROM dc_dogs')->fetchAll('obj');
And those results show correctly the 0 (zero). Is there a “bug” in querybuilder?
But I know some people are set in their ways, and this type of thing won’t change.