PHP Reserved Word used as Espo Entity Type
Collapse
X
-
I'm using EspoCRM from almost 5 years and yeah, i had to use CaseObj. I think if your business don't need different approach, i would leave it that way.Leave a comment:
-
PHP Reserved Word used as Espo Entity Type
I'm javascript proficient but not PHP. I want to add a hook for the Case entity, however "case" is a reserved in all the various languages I know and thus is not available to be used as as part of the namespace in a hook. I've seen the posts saying to use CaseObj instead, which I have done, and then had to change the path to the hook to end with CaseObj as well. The issue with this "workaround" is that when id go to do a $entity->isChanged('myfield') I get errors logged.
Message: Call to undefined method Espo\Modules\Crm\Entities\CaseObj::isChanged()
I assume this is because the namespace has overtyped the actual entity type, Case, with ChangeObj and it is not listed among the valid Entities in Espo.
My question - am I better off creating my own Entity to duplicate the Case Entity but choose another non-reserved name, or is there a good documented and test fix to workaround this issue.
Thank youTags: None

Leave a comment: