New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New entities created with only a controller in PHP; no service, repository, entity, etc. #2873
Comments
It's intentional. |
Ok, sounds good. Thanks. Is it fine for the developer to create the files if they are needed? For example, |
yeah you can create the files manually, i always do that so i could defined setters and getters on the Entities/MyEntity.php You can even create you own template if you want to and it will be merged if you added everything correctly. i have used in many project a hybride entity template BasePlusEvent which is composed of both base plus and event. |
That did not work for me. I added this file:
and then created a new I added a debug statement to be sure the file is being seen in
which resulted in the following statement in the log (why did it show a
Requests to create new entities go here:
The EditSomething must be wrong. As seen above, there shouldn't have been a
Espo ignored my |
Everything in Espo works fine as it was designed. You shouldn't create Just create an entity class in your module directory (or custom, but I recommend moving all to the module) and clear cache. |
With JSON schema it's also easy to create entities manually. I do it manually. All classes, metadata, layouts, language. |
I don't mind making everything manually. The default json file says this, though:
and only a controller is created. The file is not being used. |
This metadata is used by the class provider I referenced above. It has nothing to do with Entity Manager Tool. |
Whenever I want to quickly check where in codebase something is used I press Ctrl + Shift + F (in PhpStorm), paste the name (e.g. |
Describe the bug
It looks like 8.0 added entityTemplates, which are supposed to assist with the creation of entities based on type (base, base plus, etc.).
To Reproduce (MANDATORY, DO NOT REMOVE)
Explicit steps to reproduce the behavior:
Topic
in the Entity Manager through the GUIcustom/Espo/Custom
to see that only a controller has been createdExpected behavior
I was expecting to see:
Controllers/Topic.php
Entities/Topic.php
Repositories/Topic.php
Services/Topic.php
However, only
Controllers/Topic.php
was created.As an aside, the following json files were also created, which is consistent with my past experience:
Resources/i18n/en_US/Topic.json
Resources/metadata/clientDefs/Topic.json
Resources/metadata/clientDefs/Topic.json
Resources/metadata/entityDefs/Topic.json
Resources/metadata/recordsDefs/Topic.json
Resources/metadata/scopes/Topic.json
EspoCRM version
V8.0.0 or later
Additional context
After reviewing the code in
application/Espo/Tools/EntityManager/EntityManager.php
, I do not see a call to the template to create new files. Is this intentional? Is the controller the only file that should exist for a new entity of typebase
?The text was updated successfully, but these errors were encountered: