Bookmarker Tutorial part 1 problems

I am working through the Bookmarker tutorial and am having some problems. Toward the end we are trying to get bookmarks returned based on a tag supplied in the url. I don’t get bookmarks returned. I actually don’t see how the bookmarks and tags tables are ever associated with each other.

In the tutorial we bake 3 tables, but do not bake the bookmarks_tags table. I do not understand how this can work this way. I never end up with any data in my bookmarks_tags database table. It seems pretty clear that the bookmarks_tags table is the glue between the tags and bookmarks tables.

I can’t find where the function “findTagged(Query $query, array $options)” in BookmarksTable.php is ever even called. I know it is not being called because I can type some garbage into the function body and I do not generate an error.

Is there a step missing in the tutorial? Any help is greatly appreciated.

In the tutorial we bake 3 tables, but do not bake the bookmarks_tags table

cause you dont need that table its http://book.cakephp.org/3.0/en/orm/associations.html#belongstomany-associations relation so in this case you just need table in database but not in CakePHP

I can’t find where the function “findTagged(Query $query, array $options)” in BookmarksTable.php is ever even called

its all here http://book.cakephp.org/3.0/en/tutorials-and-examples/bookmarks/intro.html#getting-bookmarks-with-a-specific-tag what you are looking for is http://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#custom-finder-methods

Thank you for the reply. I still don’t see how/where the custom finder method is being called. I also don’t understand why I don’t have any data in my bookmarks_tags database table.

I still don’t see how/where the custom finder method is being called

// Use the BookmarksTable to find tagged bookmarks.
   $bookmarks = $this->Bookmarks->find('tagged', [
   'tags' => $tags
]);

I also don’t understand why I don’t have any data in my bookmarks_tags database table.

isnt that in 2nd part of tutorial (edit & add)? http://book.cakephp.org/3.0/en/tutorials-and-examples/bookmarks/part-two.html#fixing-list-view-and-forms

Thanks again. I guess I need to spend more time with part 1. According to the tutorial I should be presented with my bookmarks. I must have overlooked something somehow. Back to square one I guess.

After playing around with this some, I find that if I manually enter the FOREIGN KEY values into the bookmarks_tags database table, the app displays the bookmarks.

So, the problem is that it isn’t inserting the FOREIGN KEY values into the bookmarks_tags database table when new tags are created.