Log message #4203542

# At Username Text
# Sep 17th 2019, 13:42 technofection It was created in cake 3 only
# Sep 17th 2019, 13:42 felipe.marinho There's any way to create a self-related table with N levels and dinamically create the entities for it? :thinking_face: Just overthinking here...
# Sep 17th 2019, 13:42 ricksaccous if you're directly editing module 2 somehow i doubt you're loading it up with composer
# Sep 17th 2019, 13:41 daniel.upshaw Did you install new packages since you first installed Cake @technofection?
# Sep 17th 2019, 13:41 ricksaccous @technofection are you installing these packages with composer?
# Sep 17th 2019, 13:41 technofection Cake 3
# Sep 17th 2019, 13:41 daniel.upshaw Maybe try `composer dump-autoload`
# Sep 17th 2019, 13:41 ricksaccous @technofection are you using cake 2 or 3?
# Sep 17th 2019, 13:41 daniel.upshaw Composer should load everything
# Sep 17th 2019, 13:41 daniel.upshaw @technofection This is composer stuff, right?
# Sep 17th 2019, 13:40 technofection Hi guys, I am developing an app and I have some custom classes 8n src/vendor/module1 and src/vendor/module2 Now in a class in module 2, I am trying to use a class of module1 and it says class not found. Can someone suggest what wrong am I doing?
# Sep 17th 2019, 13:39 daniel.upshaw @jotpe What was it?
# Sep 17th 2019, 13:33 jotpe Found the error :slightly_smiling_face:
# Sep 17th 2019, 13:25 jotpe user_id and role_id in the other tables are also int(11) unsigned
# Sep 17th 2019, 13:24 jotpe Second one produces: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
# Sep 17th 2019, 13:23 jotpe Anyone has a clue on this issue?
# Sep 17th 2019, 13:10 ra7bi GET is working but FIND not working
# Sep 17th 2019, 13:09 ra7bi do i need to do anything more ?
# Sep 17th 2019, 13:08 ra7bi only fetching data not able
# Sep 17th 2019, 13:08 ra7bi but when i used ``` IndexRegistry::get('Users'); ``` i get nothing FYI im able to insert and edit and delete
# Sep 17th 2019, 13:07 ra7bi hello , im trying to understand this point https://book.cakephp.org/elasticsearch/2.x/en/#searching-indexed-documents but i couldn't get result from elasticsearch i created ```model/document/user.php``` then i put ``` namespace App\Model\Document; use Cake\ElasticSearch\Document; class User extends Document { } ````
# Sep 17th 2019, 12:51 henri.mjr It was what i'm looking for, valeu Felipão!
# Sep 17th 2019, 12:50 henri.mjr I'll try
# Sep 17th 2019, 12:40 felipe.marinho or even better: ```$usuario = $this->Acompanhantes->Usuarios->get($this->Auth->user('id'), ['contain' => ['grupos']]);```
# Sep 17th 2019, 12:37 felipe.marinho ```$usuario = $this->Acompanhantes->Usuarios->get($this->Auth->user('id')); $grupo = $this->Acompanhantes->Usuarios->Grupos->get($usuario->grupo_id);```
# Sep 17th 2019, 12:35 felipe.marinho Why don't you "get" the group too? the same as the User....
# Sep 17th 2019, 12:33 henri.mjr The intention is get the Grupo.name of the user (grupo_id) when in AcompanhantesController (Usuarios belongs to Grupos, Acompanhantes belongs to Usuarios)..
# Sep 17th 2019, 12:31 alexdd55976 at first look it seems fine thos
# Sep 17th 2019, 12:30 henri.mjr Hello! This is working, but i feel i'm doing something wrong... `$usuario = $this->Acompanhantes->Usuarios->get($this->Auth->user('id'));` `$grupo = $this->Acompanhantes->Usuarios->Grupos->find('all',['conditions' => ['id'=>$usuario['grupo_id']]])->first();`
# Sep 17th 2019, 11:14 jotpe thanks @conehead I ended up, with $user->setError() in the Controller
# Sep 17th 2019, 11:09 conehead BeforeMarshal is used to convert form data to saveable entities. So this is not the right spot for you
# Sep 17th 2019, 11:09 jotpe Yeah, it's not saving
# Sep 17th 2019, 11:08 conehead If you are not saving it at all or it is not related to any Entity
# Sep 17th 2019, 11:08 conehead For me it sounds more like you should validate it in your controller
# Sep 17th 2019, 11:06 jotpe It's just in the request data
# Sep 17th 2019, 11:06 jotpe Even if my Entity doesn't have the field set?
# Sep 17th 2019, 11:06 alexdd55976 i think, you can validate at any point
# Sep 17th 2019, 11:04 jotpe How can I validate a field, which is only present in the Form, but not in my Entity (e.g. comparing a `password` and a `password_repeat`? Or should I do this in beforeMarshal?
# Sep 17th 2019, 10:49 challgren Ah ha it is `Cake\TestSuite\TestEmailTransport` wonder why this transport would be default when running in Integration Test mode
# Sep 17th 2019, 10:47 jotpe ;9
# Sep 17th 2019, 10:47 jotpe Got it `$this->Authentication->setIdentity($user);`