# |
Oct 12th 2019, 08:52 |
damiano |
hmm this? https://github.com/lewestopher/cakephp-monga three years ago |
# |
Oct 12th 2019, 08:51 |
challgren |
Maybe github.com/friendsofcake/awesome-cakephp will have something that works |
# |
Oct 12th 2019, 08:50 |
damiano |
thi slibrary does not seem very followed |
# |
Oct 12th 2019, 08:50 |
damiano |
pagination is a crucial part |
# |
Oct 12th 2019, 08:50 |
damiano |
https://github.com/tiaguinho/mongodb-cakephp3/issues/26 <-- this for example |
# |
Oct 12th 2019, 08:50 |
damiano |
@challgren i think there are problems with that library :( |
# |
Oct 12th 2019, 08:49 |
slackebot1 |
!tias |
# |
Oct 12th 2019, 08:49 |
slackebot1 |
Command sent from Slack by challgren: |
# |
Oct 12th 2019, 07:23 |
damiano |
Hmm |
# |
Oct 12th 2019, 07:03 |
kazunanakama |
I believe so |
# |
Oct 12th 2019, 05:40 |
damiano |
@challgren should I change many things to use mongodb? For example the AuthComponent, does it run with Mongo too? |
# |
Oct 11th 2019, 23:51 |
challgren |
@damiano https://packagist.org/packages/hayko/mongodb |
# |
Oct 11th 2019, 23:20 |
damiano |
can we use MongoDB with Cakephp 3.8? |
# |
Oct 11th 2019, 23:19 |
damiano |
hi |
# |
Oct 11th 2019, 22:11 |
asdfgh |
hello, do you know a good plugin to compress html/css ? |
# |
Oct 11th 2019, 22:06 |
kazunanakama |
my Posts entity already has a _getAuthor() and _getParentThread() function |
# |
Oct 11th 2019, 22:05 |
kazunanakama |
how would I pass those two things? |
# |
Oct 11th 2019, 22:05 |
kazunanakama |
like $forum->latest_post($project->id, $forum->id) |
# |
Oct 11th 2019, 22:04 |
kazunanakama |
but I need to pass the project as well |
# |
Oct 11th 2019, 22:03 |
kazunanakama |
or $forum->latest_post->parent_thread->title |
# |
Oct 11th 2019, 22:03 |
kazunanakama |
I want something like $forum->latest_post->author->username |
# |
Oct 11th 2019, 22:02 |
kazunanakama |
and how do I also include that posts author object(user) and the parent thread? |
# |
Oct 11th 2019, 22:01 |
kazunanakama |
how to I call that from a view? |
# |
Oct 11th 2019, 22:01 |
kazunanakama |
``` public function getLatestPost($project_id, $forum_id){ $this->Posts = TableRegistry::get('Posts'); return $this->Posts->find('all', [ 'order' => ['Posts.created' => 'DESC'] ])->where(['project_id' => $project_id, 'forum_id' => $forum_id])->first(); }``` |
# |
Oct 11th 2019, 22:01 |
kazunanakama |
` public function getLatestPost($project_id, $forum_id){ $this->Posts = TableRegistry::get('Posts'); return $this->Posts->find('all', [ 'order' => ['Posts.created' => 'DESC'] ])->where(['project_id' => $project_id, 'forum_id' => $forum_id])->first(); }` |
# |
Oct 11th 2019, 22:01 |
kazunanakama |
So I have this in my Forum Table Model: |
# |
Oct 11th 2019, 21:58 |
kazunanakama |
but I also want it for a specific project |
# |
Oct 11th 2019, 21:58 |
kazunanakama |
I want my forum to have a "Latest Post" feature with the parent thread title, the last user that posted, and the time they posted at |
# |
Oct 11th 2019, 21:57 |
kazunanakama |
I want to know if there is a good way that I can find the latest post in a thread |
# |
Oct 11th 2019, 21:56 |
kazunanakama |
So I tried this a different way, but I have Projects, ForumCategories, Forums, Threads, and Posts |
# |
Oct 11th 2019, 20:07 |
tobse |
@this.impetus Silly question: did you already had a look for migrations? Maybe the project was developed using migrations. So it would be very easy to rebuild the database. |
# |
Oct 11th 2019, 18:36 |
slackebot1 |
<ron.rattie> |
# |
Oct 11th 2019, 18:35 |
this.impetus |
yeah, all of it, just... by hand haha. ok, cheers guys, I think if there were an easy solution here i'd have prompted it by now, thanks for reading |
# |
Oct 11th 2019, 18:34 |
ron.rattie |
should be able to glean some of the tables and relations by looking at the models |
# |
Oct 11th 2019, 18:34 |
this.impetus |
like I said, this is for a small academic lab. rewriting the tables by hand is like... one day. but it occured to me that all of this is info in implicitly modelled my cake, so, I was jut curious if there wwere a script somewhere in the cake CLI that could help |
# |
Oct 11th 2019, 18:32 |
ron.rattie |
that sucks |
# |
Oct 11th 2019, 18:32 |
this.impetus |
just me |
# |
Oct 11th 2019, 18:32 |
ron.rattie |
anyone working on the project not working directly on the db? they would have had a copy or a dump file |
# |
Oct 11th 2019, 18:32 |
this.impetus |
oh, no, if someone had to have done then it was me, and I periodically do this, but not since this project began, foolishly |
# |
Oct 11th 2019, 18:32 |
ron.rattie |
basically someone may have dumped the database or some tables into a .sql file |
# |
Oct 11th 2019, 18:32 |
this.impetus |
honestly guys I got phpmyadmin running and then never looked back, this isn't my jam at all |