If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Documentation is here. ORM - EspoCRM Documentation. getRDBRepository gives you a fully-fledged repository for interacting with an entity type in a relational database (joining, having -clauses, ordering, ...) while the class returned by getRepository only has a minimum contract (getNew, getById, save, remove).
Documentation is here. ORM - EspoCRM Documentation. getRDBRepository gives you a fully-fledged repository for interacting with an entity type in a relational database (joining, having -clauses, ordering, ...) while the class returned by getRepository only has a minimum contract (getNew, getById, save, remove).
ok, that's good to know, but where abouts do you see that i just see them randomly used without any explanation of what each one does
ok, that's good to know, but where abouts do you see that i just see them randomly used without any explanation of what each one does
I think the documentation I linked to quite consistently uses the RDBRepository, which to me makes sense as that's the more capable one, with SQL filtering functions and access to an RDBSelectBuilder for creating more complex queries. That's also what I've used so far for my "exploratory coding" since starting my Espo journey a few months ago. I mainly use the official documentation, which I find good, and the Espo source on GitHub to do my things. Can't really speak for other sources, sorry.
I think the documentation I linked to quite consistently uses the RDBRepository, which to me makes sense as that's the more capable one, with SQL filtering functions and access to an RDBSelectBuilder for creating more complex queries. That's also what I've used so far for my "exploratory coding" since starting my Espo journey a few months ago. I mainly use the official documentation, which I find good, and the Espo source on GitHub to do my things. Can't really speak for other sources, sorry.
That's the thing it never explains what the difference is, just shows some random examples, and without more knowledge, you can't build the knowledge without painful trial and error. When I see it i just see a dump of functions with little to no explanation on how to use them or what the difference is, ultimately very poor documentation you might have the time and energy to waste on "exploratory coding," but i got things to deliver as i am managing espo for a medium-sized company
at the moment, the only way the docs are vaguely usable is with AI assistance which even then tends to get things drastically wrong
That's the thing it never explains what the difference is, just shows some random examples, and without more knowledge, you can't build the knowledge without painful trial and error. When I see it i just see a dump of functions with little to no explanation on how to use them or what the difference is, ultimately very poor documentation you might have the time and energy to waste on "exploratory coding," but i got things to deliver as i am managing espo for a medium-sized company
at the moment, the only way the docs are vaguely usable is with AI assistance which even then tends to get things drastically wrong
What is time wasted to one, is learning to the other... And what makes you think I don't have deliverables? You don't need to take your frustrations out on me, I was trying to help by pointing to the documentation, which I've found to be pretty helpful. By using the documentation, Espo's sources, ChatGPT and this forum, I've managed to build 3 extension with several features between them (custom dashlet, hooks, Primary Filters, an extension to the Flotr2 graph lib, a Lead Capture style public form, custom front-end modals...). I have noticed that ChatGPT tend to focus on v7/v8 of Espo, not the current 9. So that's something to be aware of.
I don't know what kind of documentation you are looking for. For as large a platform as Espo is, I think it would be quite hard to provide a 100 % "if you need that, use this" style of documentation.
What is time wasted to one, is learning to the other... And what makes you think I don't have deliverables? You don't need to take your frustrations out on me, I was trying to help by pointing to the documentation, which I've found to be pretty helpful. By using the documentation, Espo's sources, ChatGPT and this forum, I've managed to build 3 extension with several features between them (custom dashlet, hooks, Primary Filters, an extension to the Flotr2 graph lib, a Lead Capture style public form, custom front-end modals...). I have noticed that ChatGPT tend to focus on v7/v8 of Espo, not the current 9. So that's something to be aware of.
I don't know what kind of documentation you are looking for. For as large a platform as Espo is, I think it would be quite hard to provide a 100 % "if you need that, use this" style of documentation.
sorry i didn't mean to direct any of it towards you, just the frustration at the poor documentation.
For the most part, i find the documentation to be more confusing than helpful, just kind of dumped there with no explanation and as you say, you need to use 3 other sources to get work done, just proves how bad the documentation is
i am not expecting 100% of the most minute parts of Espo, but something that is geared to actually teaching you how to start is kind of the norm with most successful projects. Look at any long-running, widely used open source project, Laravel, for example. Documentation is a key part of it, not some afterthought with the ethos that " the users will have to dig through code and annoy other users to get a basic understanding."
This topic, for example, i can't find anywhere on the page where it explains the difference between the 2 functions, sure it shows that there are differences but what are they, why are they, when would i use one v the other??? no idea, just a bunch of examples dumped on the page with near enough no explanation
This is not the way to grow a community. People will come here, get frustrated, and go to a worse yet better documented product. Why? because they can use it without having to go through 4 different sources to figure it out
Sorry for the rant, i am just so frustrated with the documentation ethos here, why make this harder to use than it needs to be?
There's no need to keep repeating the same over on the forum. Your feedback has been heard. The documentation is not very good for you. Keep repeating the same over and over stops being a feedback and becomes a harassment.
If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.
sorry i didn't mean to direct any of it towards you, just the frustration at the poor documentation.
For the most part, i find the documentation to be more confusing than helpful, just kind of dumped there with no explanation and as you say, you need to use 3 other sources to get work done, just proves how bad the documentation is
i am not expecting 100% of the most minute parts of Espo, but something that is geared to actually teaching you how to start is kind of the norm with most successful projects. Look at any long-running, widely used open source project, Laravel, for example. Documentation is a key part of it, not some afterthought with the ethos that " the users will have to dig through code and annoy other users to get a basic understanding."
This topic, for example, i can't find anywhere on the page where it explains the difference between the 2 functions, sure it shows that there are differences but what are they, why are they, when would i use one v the other??? no idea, just a bunch of examples dumped on the page with near enough no explanation
This is not the way to grow a community. People will come here, get frustrated, and go to a worse yet better documented product. Why? because they can use it without having to go through 4 different sources to figure it out
Sorry for the rant, i am just so frustrated with the documentation ethos here, why make this harder to use than it needs to be?
Laravel is an application framework, its sole purpose is to be used for coding, building applications. That's why it needs to be well documented from that aspect. Espo is an application in itself, with great extension possibilities. If you compare Espo's administration and user guides to its developer documentation, you are right that the latter is thinner. Still IMHO decent. I guess it's a resource issue: if 80 % of users install Espo and configure it through the UI, 80 % of the documentation efforts tend to go towards that.
It's around five months since I first installed Espo and I have say a month and a half of more serious, but still side-project, dev experience now. This is my take on how to get up to speed with development*
Use the ext-template repo described in the documentation
Understand the dependency injection system. It's really powerful
Know the metadata (this is well documented)
Learn the ORM
Build the entity you need in the UI, look at what's generated
Familiarize yourself with the source code
YMMV on the last one, but the source code is the definitive truth about Espo, so I thought I might as well bite the bullet early.
To go back your specific question on getRDBRepository vs getRepository. I'd say it depends on what you need. For just creating and saving an entity, both are good (you can also use the shortcuts getNewEntity and saveEntity on the entity manager). For querying the database, joining, where clauses, use getRDBRepository. *I'm not claiming this is the wayto learn Espo or that you are going about things the wrong way. It's just my personal take and how I've got going.
For developers, I always highly recommend to set up the IDE first, so that all type hinting is supported including the generic/templates. This is essential, without it developing will be much more difficult. For a good written library I may find myself not checking docs at all. Or there are often almost no docs. All the docs is code and the IDE makes it easier to understand.
If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.
To answer the original question. tgr explained it correctly. The getRepository method is kept for non-RDB storage types. It won't be ever needed for 99% developers.
If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.
Comment