From f2e955e74d057f3feb134fb6623e652a4adf44fa Mon Sep 17 00:00:00 2001 From: argiepiano Date: Wed, 12 Mar 2025 09:26:06 -0600 Subject: [PATCH] Issue #151. Define entity properties in the class definitions. Fixes #151. --- includes/og.membership.inc | 67 +++++++++++++++++++++++++++++++++ includes/og.membership_type.inc | 39 +++++++++++++++++++ 2 files changed, 106 insertions(+) diff --git a/includes/og.membership.inc b/includes/og.membership.inc index de30c8bb..14999d15 100644 --- a/includes/og.membership.inc +++ b/includes/og.membership.inc @@ -9,6 +9,73 @@ * empty functions. */ class OgMembership extends Entity { + + /** + * The membership ID. + * + * @var integer + */ + public $id; + + /** + * The membership type. + * + * @var string + */ + public $type; + + /** + * The entity ID. + * + * @var integer + */ + public $etid; + + /** + * The entity type. + * + * @var string + */ + public $entity_type; + + /** + * The group's unique ID. + * + * @var integer + */ + public $gid; + + /** + * The group's entity type (e.g. node, comment, etc). + * + * @var string + */ + public $group_type; + + /** + * The state of the group content. + * + * @var string + */ + public $state; + + /** + * The name of the field holding the group ID. + * + * The name of the field holding the group ID, the OG memebership is + * associated with., the OG memebership is associated with. + * + * @var string + */ + public $field_name; + + /** + * The language of this membership. + * + * @var string + */ + public $language; + /** * Implements EntityInterface::id(). */ diff --git a/includes/og.membership_type.inc b/includes/og.membership_type.inc index dac23b60..8934176d 100644 --- a/includes/og.membership_type.inc +++ b/includes/og.membership_type.inc @@ -6,9 +6,48 @@ */ class OgMembershipType extends Entity { + /** + * Primary Key: Numeric group membership type ID. + * + * @var integer + */ + public $id; + + /** + * The unified identifier for a group membership type. + * + * @var $string + */ public $name; + + /** + * Description for this group membership type. + * + * @var string + */ public $description = ''; + /** + * The name of the providing module if the entity has been defined in code. + * + * @var string + */ + public $module; + + /** + * The language of this membership type. + * + * @var string + */ + public $language; + + /** + * The exportable status of the entity. + * + * @var bool + */ + public $status; + public function id() { return isset($this->id) ? $this->id : NULL; }