# |
Jan 6th 2020, 16:37 |
ricksaccous |
$matchEntity = $this->Matches->find()->matching('SeasonsPlayers', function ($query) use ($id) { return $query->where(['SeasonsPlayers.club_id' => $id]); })->contain(['Foo','Bar']); |
# |
Jan 6th 2020, 16:37 |
gianmarxgagliardi |
it gives me an empty set |
# |
Jan 6th 2020, 16:36 |
gianmarxgagliardi |
it gives me the whole empty |
# |
Jan 6th 2020, 16:36 |
ricksaccous |
replace where with matching i already told you |
# |
Jan 6th 2020, 16:35 |
gianmarxgagliardi |
```$matchHome1 = $this->Matches->find('all') ->where(['MatchPlayers.SeasonPlayers.club_id' => $matchHome->club_home_id]) ->contain(['SeasonReferees','SeasonReferees.Referees', 'ClubsHome', 'MatchPlayers','MatchPlayers.SeasonPlayers','MatchPlayers.SeasonPlayers.Players']);``` |
# |
Jan 6th 2020, 16:34 |
gianmarxgagliardi |
ok it turns but some problem |
# |
Jan 6th 2020, 16:27 |
ricksaccous |
i'll help |
# |
Jan 6th 2020, 16:27 |
ricksaccous |
read the thing and try to figure it out if you still have trouble after reading |
# |
Jan 6th 2020, 16:27 |
gianmarxgagliardi |
? |
# |
Jan 6th 2020, 16:27 |
gianmarxgagliardi |
how could I do |
# |
Jan 6th 2020, 16:23 |
ricksaccous |
etc |
# |
Jan 6th 2020, 16:23 |
ricksaccous |
->matching('SeasonPlayers', function ($q) |
# |
Jan 6th 2020, 16:23 |
ricksaccous |
you're right sorry |
# |
Jan 6th 2020, 16:23 |
ricksaccous |
and use matching |
# |
Jan 6th 2020, 16:23 |
ricksaccous |
actually you could keep what you have without the where |
# |
Jan 6th 2020, 16:22 |
ricksaccous |
read this |
# |
Jan 6th 2020, 16:22 |
ricksaccous |
https://book.cakephp.org/3/en/orm/retrieving-data-and-resultsets.html |
# |
Jan 6th 2020, 16:22 |
gianmarxgagliardi |
i have to compare club id |
# |
Jan 6th 2020, 16:21 |
ricksaccous |
i probably should not spoon feed you so much |
# |
Jan 6th 2020, 16:21 |
gianmarxgagliardi |
I do not understand |
# |
Jan 6th 2020, 16:21 |
ricksaccous |
Matches.id => $id |
# |
Jan 6th 2020, 16:21 |
ricksaccous |
and you set the where to be |
# |
Jan 6th 2020, 16:20 |
ricksaccous |
you keep the matching you had |
# |
Jan 6th 2020, 16:16 |
gianmarxgagliardi |
Unknown method "has" |
# |
Jan 6th 2020, 16:16 |
gianmarxgagliardi |
```$matchHome=$this->Matches->find() ->contain('SeasonReferees','SeasonReferees.Referees', 'ClubsHome', 'MatchPlayers','MatchPlayers.SeasonPlayers','MatchPlayers.SeasonPlayers.Players') ->where(['SeasonPlayers.club_id' => 3]);``` |
# |
Jan 6th 2020, 16:13 |
ricksaccous |
no not really you simply create a table class and set the table to the view and you should be fine |
# |
Jan 6th 2020, 16:12 |
luizcmarin |
* Any information about this in the manual? |
# |
Jan 6th 2020, 16:12 |
luizcmarin |
thanks you |
# |
Jan 6th 2020, 16:12 |
luizcmarin |
but what interests me most is displaying the data, so that's fine with me right now. |
# |
Jan 6th 2020, 16:10 |
ricksaccous |
it's mostly for reading conglomerated data |
# |
Jan 6th 2020, 16:10 |
ricksaccous |
i don't think you can update or delete from a view though |
# |
Jan 6th 2020, 16:10 |
ricksaccous |
you can select from a view |
# |
Jan 6th 2020, 16:10 |
ricksaccous |
yeah for you |
# |
Jan 6th 2020, 16:08 |
luizcmarin |
"yeah" for me, @ricksaccous? Show ! |
# |
Jan 6th 2020, 16:07 |
ricksaccous |
yeah |
# |
Jan 6th 2020, 16:07 |
luizcmarin |
I have some views created on mysql. Can I use them the same way as a normal table in cake? |
# |
Jan 6th 2020, 16:06 |
luizcmarin |
hi |
# |
Jan 6th 2020, 16:06 |
ricksaccous |
yeah because you have to do $this->Matches->find()->where(['']) |
# |
Jan 6th 2020, 16:03 |
gianmarxgagliardi |
with find `Unknown finder method "4"` |
# |
Jan 6th 2020, 16:00 |
gianmarxgagliardi |
in the controller Matches |
# |
Jan 6th 2020, 16:00 |
ricksaccous |
welp, good luck |