# |
Dec 27th 2019, 15:51 |
alexdd55976 |
```$usernames = $this->find('list') ->select(['internal_username']) ->disableHydration() ->toArray();``` |
# |
Dec 27th 2019, 15:51 |
alexdd55976 |
i get this with fnd list |
# |
Dec 27th 2019, 15:50 |
alexdd55976 |
```Array ( [0] => 1 [1] => 2 )``` |
# |
Dec 27th 2019, 15:47 |
dereuromark |
you didnt use find(list), thats why you have a deep array here |
# |
Dec 27th 2019, 15:47 |
dereuromark |
but tbh, the given list of key=>value usually should suffice. |
# |
Dec 27th 2019, 15:47 |
dereuromark |
sure, array_keys() on the find list^^ |
# |
Dec 27th 2019, 15:46 |
alexdd55976 |
i only get this ```Array ( [0] => Array ( [internal_username] => maa ) [1] => Array ( [internal_username] => mal ) )``` |
# |
Dec 27th 2019, 15:45 |
alexdd55976 |
nothing around it, just the array |
# |
Dec 27th 2019, 15:45 |
alexdd55976 |
is it possible to get an array from a `->find()` which only has a list like `['a','b','c']`? |
# |
Dec 27th 2019, 15:06 |
gianmarxgagliardi |
or to avoid that there is A vs B on day 2 and there is A vs B on day 3 |
# |
Dec 27th 2019, 15:05 |
gianmarxgagliardi |
to avoid that on day 3 there is A vs B and A vs C |
# |
Dec 27th 2019, 15:04 |
gianmarxgagliardi |
sorry how can I build a rules that checks in the DB if that game has already been entered or if that team cannot be entered because it already has a match for that championship day |
# |
Dec 27th 2019, 14:48 |
jotpe |
I would search somewhere over here: https://book.cakephp.org/3/en/orm/validation.html#applying-application-rules |
# |
Dec 27th 2019, 14:45 |
gianmarxgagliardi |
sorry you know how consistency checks are done. For example, to prevent a certain value with a certain parameter from being entered multiple times? if there is anything in the documentation |
# |
Dec 27th 2019, 14:29 |
slackebot |
]); $this->belongsTo('Clubs', [ 'foreignKey' => 'club_home_id', 'joinType' => 'INNER', ]); $this->belongsTo('Clubs', [ 'foreignKey' => 'club_visitor_id', 'joinType' => 'INNER', ]);``` |
# |
Dec 27th 2019, 14:29 |
gianmarxgagliardi |
```$this->belongsTo('ClubsHome', [ 'className' => 'Clubs', 'foreignKey' => 'club_home_id', 'joinType' => 'INNER', ]); $this->belongsTo('ClubsVisitor', [ 'className' => 'Clubs', 'foreignKey' => 'club_visitor_id', 'joinType' => 'INNER', |
# |
Dec 27th 2019, 14:29 |
gianmarxgagliardi |
I solved it like this |
# |
Dec 27th 2019, 14:28 |
peppejaripappalardo |
i check, thx ndm |
# |
Dec 27th 2019, 14:05 |
ndm |
some sort of socket file issue, double check your config |
# |
Dec 27th 2019, 13:57 |
peppejaripappalardo |
Hello to all, someone got this error? ```SQLSTATE[HY000] [2002] No such file or directory``` With native PDO and with workbench i am able to connect into db from remote, but cake generate the error above... Someone have an hint? |
# |
Dec 27th 2019, 13:46 |
gianmarxgagliardi |
@jotpe |
# |
Dec 27th 2019, 13:46 |
gianmarxgagliardi |
if I put clubs it overwrites club_home_id and I had the values available only for club_visitor_id |
# |
Dec 27th 2019, 13:44 |
gianmarxgagliardi |
I need two arrays of values for club_home_id and club_visitor_id |
# |
Dec 27th 2019, 13:43 |
gianmarxgagliardi |
yes i am aware of it |
# |
Dec 27th 2019, 13:41 |
jotpe |
@gianmarxgagliardi your Models are named ClubsHome/ClubsVisitor not Clubs |
# |
Dec 27th 2019, 13:30 |
gianmarxgagliardi |
```$this->hasMany('Matchs', [ 'foreignKey' => 'club_home_id', ]); $this->hasMany('Matchs', [ 'foreignKey' => 'club_visitor_id', ]);``` |
# |
Dec 27th 2019, 13:30 |
gianmarxgagliardi |
in ClubsTable |
# |
Dec 27th 2019, 13:28 |
slackebot |
])``` |
# |
Dec 27th 2019, 13:28 |
gianmarxgagliardi |
```$this->belongsTo('ClubsHome', [ 'className' => 'Clubs', 'foreignKey' => 'club_home_id', 'joinType' => 'INNER', ]); $this->belongsTo('ClubsVisitor', [ 'className' => 'Clubs', 'foreignKey' => 'club_visitor_id', 'joinType' => 'INNER', |
# |
Dec 27th 2019, 13:28 |
gianmarxgagliardi |
in MatchesTable |
# |
Dec 27th 2019, 13:28 |
gianmarxgagliardi |
when i add (in matches controller) it gives me this error: `ExistsIn rule for 'club_home_id' is invalid. 'Clubs' is not associated with 'App\Model\Table\MatchesTable'.` |
# |
Dec 27th 2019, 13:14 |
slackebot |
<ashesh.social> |
# |
Dec 27th 2019, 13:13 |
ashesh.social |
Tried adding mailgun to my project and started following the steps where @challgren posted. Finding a issue while composer require |
# |
Dec 27th 2019, 13:10 |
peppejaripappalardo |
i doing it |
# |
Dec 27th 2019, 12:25 |
dereuromark |
I still didnt publish my 1year old heroku blog post, time to do that now on xmas holidays: https://www.dereuromark.de/2019/12/27/cakephp-and-heroku/ |
# |
Dec 27th 2019, 12:23 |
dereuromark |
or you have a more complex app? |
# |
Dec 27th 2019, 12:05 |
dereuromark |
works fine. |
# |
Dec 27th 2019, 12:05 |
dereuromark |
do you need docker for this? I just deployed a normal app using basic composer commands. |
# |
Dec 27th 2019, 12:02 |
wizardfix |
Using Docker, I mean. :) |
# |
Dec 27th 2019, 11:55 |
wizardfix |
Hi. :) I want to containerise a CakePHP 3.8 application for deployment to Heroku. Can anyone please recommend a good guide / things to look out for? :thinking_face: |
# |
Dec 27th 2019, 11:40 |
gianmarxgagliardi |
thanks it's work |