# |
Jan 14th 2020, 18:47 |
andre.karner |
Got it .. thank you so much guys. |
# |
Jan 14th 2020, 18:46 |
ndm |
Because PSR-4 autoloading matches classnames to filenames, so `users` will translate to `usersTable.php` |
# |
Jan 14th 2020, 18:46 |
ricksaccous |
https://book.cakephp.org/3/en/intro/conventions.html |
# |
Jan 14th 2020, 18:45 |
andre.karner |
i dont get it |
# |
Jan 14th 2020, 18:45 |
andre.karner |
could you explain me, why obtaining the table with lowercase notation is wrong? |
# |
Jan 14th 2020, 18:43 |
andre.karner |
but this wasnt really the problem .. it actually was a missing "s" on the "UserController" --> "UsersController" |
# |
Jan 14th 2020, 18:43 |
ndm |
there you go |
# |
Jan 14th 2020, 18:42 |
andre.karner |
``` public static function getTable() : Table { return TableRegistry::getTableLocator()->get('users'); }``` |
# |
Jan 14th 2020, 18:42 |
andre.karner |
I do this the same way .. :face_with_rolling_eyes: |
# |
Jan 14th 2020, 18:41 |
ndm |
If you're obtaining the users table the same way as the products table, that is with lowercase notation, then that's likely the source of the problem |
# |
Jan 14th 2020, 18:40 |
ricksaccous |
your problem is still probably a misnamed file |
# |
Jan 14th 2020, 18:40 |
andre.karner |
:thumbsup: |
# |
Jan 14th 2020, 18:40 |
ricksaccous |
just some extra tips |
# |
Jan 14th 2020, 18:40 |
ricksaccous |
no |
# |
Jan 14th 2020, 18:39 |
andre.karner |
but yes .. you are write - i'd better move this code the controller .. however, do you think that this leads to my problem? |
# |
Jan 14th 2020, 18:38 |
andre.karner |
also not in static functions? |
# |
Jan 14th 2020, 18:37 |
ricksaccous |
you shouldn't be doing things like that, imo, it's just going to bite you in the butt |
# |
Jan 14th 2020, 18:37 |
ricksaccous |
also you aren't really following cake conventions by loading a table class in an entity |
# |
Jan 14th 2020, 18:36 |
andre.karner |
4.0.1 on both |
# |
Jan 14th 2020, 18:35 |
ricksaccous |
do you have 2 different versions of cake? |
# |
Jan 14th 2020, 18:34 |
andre.karner |
jesus |
# |
Jan 14th 2020, 18:34 |
andre.karner |
well ... get_class() gives different outputs on both systems - while its a User class on local machine it is a "entity" on remote |
# |
Jan 14th 2020, 18:33 |
ricksaccous |
in a users plugin, rector doesn't know what to do, i suppose i could load all these files manually but there has to be a better way |
# |
Jan 14th 2020, 18:33 |
ricksaccous |
```namespace Users\Traits;``` |
# |
Jan 14th 2020, 18:33 |
ricksaccous |
like |
# |
Jan 14th 2020, 18:33 |
ricksaccous |
not all unix systems are created equal |
# |
Jan 14th 2020, 18:32 |
andre.karner |
but let me check the result of get_class() |
# |
Jan 14th 2020, 18:32 |
ricksaccous |
so i noticed that rector is not autoloading all files in my "plugins" folder which it should via vendor/cakephp-plugins.php in the autoload but if i have for instance a trait class namespaced |
# |
Jan 14th 2020, 18:32 |
andre.karner |
both systems are running on an unix system .. one on docker and the remote one on ubuntu |
# |
Jan 14th 2020, 18:31 |
ndm |
I don't want to jump to conclusions yet, but very likely filesystem a case sensitivity issue, at least that's the issue 9 out 10 times |
# |
Jan 14th 2020, 18:31 |
ricksaccous |
are you sure you don't have mistyped casing in your folder or file names? |
# |
Jan 14th 2020, 18:30 |
andre.karner |
the funny thing is, the same code works on my local machine .. just not on the remote one |
# |
Jan 14th 2020, 18:29 |
ndm |
@andre.karner `$user` probably isn't what you think it is, check `debug(get_class($user))` |
# |
Jan 14th 2020, 18:27 |
ricksaccous |
okay it's reading from my yaml just not working, hmmmm |
# |
Jan 14th 2020, 18:27 |
andre.karner |
and that: https://github.com/cakephp/cakephp/issues/14172 |
# |
Jan 14th 2020, 18:26 |
andre.karner |
anyone encountered similar issue like that? https://github.com/cakephp/cakephp/issues/14171 |
# |
Jan 14th 2020, 18:25 |
andre.karner |
hey guys - since my issue on github got closed I am trying to find help here, although i think that it is a bug .. |
# |
Jan 14th 2020, 18:12 |
ricksaccous |
do i have to do rectory rector.yaml? like feed the file to the command |
# |
Jan 14th 2020, 18:12 |
ricksaccous |
the docs don't say you have to do anything special |
# |
Jan 14th 2020, 18:12 |
ricksaccous |
how can i make sure rector is reading from rector.yaml? |
# |
Jan 14th 2020, 17:01 |
this.impetus |
Yeah, I just got there; `$query->execute()->fetchAll()` gets it done, tyvm. |