Elgg data mode is designed such that it allows users to create new plugins, even plugins with its own data types without creating new tables in the database. This feature offers many benefits as well as poses problems. The elgg way to is to work with the conceptual data model without modifying the database. An ER diagram of the database would only cause confusion since elgg the entity model has been abstracted in the elgg core.
Elgg works with atomic data units called entities. From programming perspective, an entity is an object of ElggEntity class. All entities extend this class. For most of your development work, you would be working with the following classes which extend ElggEntity:
- ElggGroup: collection of objects of type ElggUser
- ElggObject: blogs, files, bookmarks, pages, etc.
- ElggSite: You can run several sites on a single elgg installation. Each ElggSite object references a site
- ElggUser:
In addition to the ElggEntity classes, elgg also provides several helper classes such as ElggAnnotation. This class allows users to add additional information to an entity. For example, comments on video.
Entity and helper classes are located in /engine/lib. You should not modify any of these files.
Elgg actions provide developers an easy and standardized way to add interactivity to their plugins. Actions need to be registered before they can be used. Actions are defined inside individual modules inside the actions directory.
Elgg has an advanced event handling system. Events are triggered by user or system actions. Plugin developers need to register their event handlers for events for every event they want their plugin to respond to.