abstract class PlUser
{
/**
+ * User data enumerations.
+ */
+ const GENDER_FEMALE = true;
+ const GENDER_MALE = false;
+ const FORMAT_HTML = "html";
+ const FORMAT_TEXT = "text";
+
+ /**
* User data storage.
* By convention, null means the information hasn't been fetched yet, and
* false means the information is not available.
protected $full_name = null;
protected $promo = null;
+ // Other important parameters used when sending emails.
+ protected $gender = null; // Acceptable values are GENDER_MALE and GENDER_FEMALE
+ protected $email_format = null; // Acceptable values are FORMAT_HTML and FORMAT_TEXT
+
// Permissions
protected $perms = null;
protected $perm_flags = null;
return $this->full_name;
}
+ public function promo()
+ {
+ return $this->promo;
+ }
+
+ // Fallback value is GENDER_MALE.
+ public function isFemale()
+ {
+ return $this->gender == self::GENDER_FEMALE;
+ }
+
+ // Fallback value is FORMAT_TEXT.
+ public function isEmailFormatHtml()
+ {
+ return $this->email_format == self::FORMAT_HTML;
+ }
+
/**
* Other properties are available directly through the $data array, or as
* standard object variables, using a getter.