Description
Link to page: Working with databases
I'm following this guide and writing the code to better understand it. After completing each file, I performed a test by submitting the data to the page table and received the following error:
throwable: Error: Object of class DateTimeImmutable could not be converted to string in /var/www/app/vendor/yiisoft/db/src/Driver/Pdo/AbstractPdoCommand.php:173
I went to the save() method of the PageRepository and forced a formatting, then received another error:
throwable: PDOException: SQLSTATE[42703]: Undefined column: 7 ERROR: column "createdAt" of relation "page" does not exist
I compared it with the columns of the table created in the migration, and they are different: created_at and updated_at. I adjusted the columns in the save() and createPage() methods, and it worked.
When you can, please validate this detail. Thank you!
Description
Link to page: Working with databases
I'm following this guide and writing the code to better understand it. After completing each file, I performed a test by submitting the data to the page table and received the following error:
throwable: Error: Object of class DateTimeImmutable could not be converted to string in /var/www/app/vendor/yiisoft/db/src/Driver/Pdo/AbstractPdoCommand.php:173I went to the
save()method of thePageRepositoryand forced a formatting, then received another error:throwable: PDOException: SQLSTATE[42703]: Undefined column: 7 ERROR: column "createdAt" of relation "page" does not existI compared it with the columns of the table created in the migration, and they are different:
created_atandupdated_at. I adjusted the columns in thesave()andcreatePage()methods, and it worked.When you can, please validate this detail. Thank you!