# Argument 1 passed to Cake\ORM\Entity::get() must be of the type string, int given, called in C:\xampp\htdocs\myproject\vendor\cakephp\cakephp\src\Datasource\EntityTrait.php on line 604
CategoriesTable.php:
This is my table database: id int(11) NOT NULL, slug varchar(255) NOT NULL, parent_id int(11) NOT NULL, description varchar(50) NOT NULL, modified datetime NOT NULL, created datetime NOT NULL
i have the this record on database:
(1, ‘test0’, 0, ‘Catalogo’, ‘2020-10-19 01:46:09’, ‘2020-10-18 23:50:56’),
(2, ‘test1’, 0, ‘Usado’, ‘2020-10-19 01:46:17’, ‘2020-10-19 01:29:54’),
(3, ‘test01’, 1, ‘Motocultivador’, ‘2020-10-20 01:56:55’, ‘2020-10-20 01:56:55’);
I can retrieve children without error but not the parent.
I found the problem is in my view, thank for your help, I used the wrong field name $category->parent[0]->description;
instead of $category->parent->description;
@Jawfin I thought that relationship looked hinky too. But I couldn’t get my brain to engage with an answer. I wonder if this will be a lurking bug for @mokiwaa or if we’re both thinking about it wrong.