Skip to content
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

Single location for entity type list definition (Trac #4272) #4272

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 7 comments
Closed

Single location for entity type list definition (Trac #4272) #4272

elgg-gitbot opened this issue Feb 16, 2013 · 7 comments
Labels
Milestone

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/4272 on 42014813-06-23 by trac user mrclay, assigned to unknown.

Elgg version: 1.8.2

Currently the mapping of entity types to classnames is hardcoded:
https://github.com/Elgg/Elgg/blob/1.8/engine/lib/entities.php#L631
https://github.com/Elgg/Elgg/blob/1.8/engine/lib/entities.php#L964
https://github.com/Elgg/Elgg/blob/1.8/engine/lib/entities.php#L1552
(and probably more)

While entity types are rarely added (and shouldn't generally be by plugins), I need it for my plugin :)
https://github.com/mrclay/Elgg-xcollection
I had to fork get_entity(as_row) and delete_entity to workaround this, but I'd have to fork a lot more to support metadata, etc.

In the short run I may have to rewrite this as an ElggObject, though this would add more work porting it back into core later.

@elgg-gitbot
Copy link
Author

trac user mrclay wrote on 42016865-06-01

I've recoded my plugin as an ElggObject so I've personally no immediate need for this. Further I don't think it's wise to enable this by plugin devs (e.g. would we have to give devs the ability to alter the entities.type ENUM?); using objects is probably a "good enough" way to model future potential entities.

@elgg-gitbot
Copy link
Author

cash wrote on 42016887-08-30

I left a comment on http://community.elgg.org/pg/forum/topic/830706/entity-list-spec/

Independent of your work, it makes sense to put all the entity types in a central place.

@elgg-gitbot
Copy link
Author

Milestone changed to Elgg 1.8.3 by cash on 42016887-08-30

@elgg-gitbot
Copy link
Author

Title changed from Need way to add entity types at runtime to Single location for entity type list definition by cash on 42016887-08-30

@elgg-gitbot
Copy link
Author

Milestone changed to Elgg 1.8.4 by cash on 42019799-09-13

@elgg-gitbot
Copy link
Author

trac user Cash Costello wrote on 42067488-03-17

Fixes #4272 where an array of entity types can be used, use array in config object
Changeset: 5a3390f

@elgg-gitbot
Copy link
Author

trac user Cash Costello wrote on 42088991-01-29

Fixes #4272 where an array of entity types can be used, use array in config object
Changeset: 5a3390f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant