*/
protected $attributes = array();
+ /**
+ * Initialise the attributes array.
+ *
+ * This is vital to distinguish between metadata and base parameters.
+ *
+ * @param bool $pre18_api Compatibility for subclassing in 1.7 -> 1.8 change.
+ * Passing true (default) emits a deprecation notice.
+ * Passing false returns false. Core constructors always pass false.
+ * Does nothing either way since attributes are initialized by the time
+ * this is called.
+ * @return false|void False is
+ * @deprecated 1.8 Use initializeAttributes()
+ */
+ protected function initialise_attributes($pre18_api = true) {
+ if ($pre18_api) {
+ elgg_deprecated_notice('initialise_attributes() is deprecated by initializeAttributes()', 1.8);
+ } else {
+ return false;
+ }
+ }
+
/**
* Initialize the attributes array.
*
*/
protected $volatile = array();
- /**
- * Initialise the attributes array.
- *
- * This is vital to distinguish between metadata and base parameters.
- *
- * @return void
- * @deprecated 1.8 Use initializeAttributes()
- */
- protected function initialise_attributes() {
- elgg_deprecated_notice('ElggEntity::initialise_attributes() is deprecated by ::initializeAttributes()', 1.8);
-
- $this->initializeAttributes();
- }
-
/**
* Initialize the attributes array.
*
class ElggGroup extends ElggEntity
implements Friendable {
-
/**
* Sets the type to group.
*
*
* @deprecated 1.8 Use initializeAttributes
*/
- protected function initialise_attributes() {
- elgg_deprecated_notice('ElggGroup::initialise_attributes() is deprecated by ::initializeAttributes()', 1.8);
- return $this->initializeAttributes();
- }
-
- /**
- * Sets the type to group.
- *
- * @return void
- *
- * @see ElggEntity::initialise_attributes()
- */
protected function initializeAttributes() {
parent::initializeAttributes();
function __construct($guid = null) {
$this->initializeAttributes();
+ // compatibility for 1.7 api.
+ $this->initialise_attributes(false);
+
if (!empty($guid)) {
// Is $guid is a DB row - either a entity row, or a user table row.
if ($guid instanceof stdClass) {
* @subpackage DataModel.Object
*/
class ElggObject extends ElggEntity {
- /**
- * Initialise the attributes array to include the type,
- * title, and description.
- *
- * @deprecated 1.8 use ElggEntity::initializeAttributes()
- *
- * @return void
- */
- protected function initialise_attributes() {
- elgg_deprecated_notice('ElggObject::initialise_attributes() is deprecated by ::initializeAttributes()', 1.8);
-
- return $this->initializeAttributes();
- }
/**
* Initialise the attributes array to include the type,
function __construct($guid = null) {
$this->initializeAttributes();
+ // compatibility for 1.7 api.
+ $this->initialise_attributes(false);
+
if (!empty($guid)) {
// Is $guid is a DB row - either a entity row, or a object table row.
if ($guid instanceof stdClass) {
* @link http://docs.elgg.org/DataModel/Sites
*/
class ElggSite extends ElggEntity {
- /**
- * Initialise the attributes array.
- * This is vital to distinguish between metadata and base parameters.
- *
- * Place your base parameters here.
- *
- * @deprecated 1.8 Use ElggSite::initializeAttributes()
- *
- * @return void
- */
- protected function initialise_attributes() {
- elgg_deprecated_notice('ElggSite::initialise_attributes() is deprecated by ::initializeAttributes()', 1.8);
-
- return $this->initializeAttributes();
- }
/**
* Initialise the attributes array.
function __construct($guid = null) {
$this->initializeAttributes();
+ // compatibility for 1.7 api.
+ $this->initialise_attributes(false);
+
if (!empty($guid)) {
// Is $guid is a DB row - either a entity row, or a site table row.
if ($guid instanceof stdClass) {
*/
class ElggUser extends ElggEntity
implements Friendable {
- /**
- * Initialise the attributes array.
- * This is vital to distinguish between metadata and base parameters.
- *
- * Place your base parameters here.
- *
- * @deprecated 1.8 Use ElggUser::initializeAttributes()
- *
- * @return void
- */
- protected function initialise_attributes() {
- elgg_deprecated_notice('ElggUser::initialise_attributes() is deprecated by ::initializeAttributes()', 1.8);
-
- return $this->initializeAttributes();
- }
- /**
+ /**
* Initialise the attributes array.
* This is vital to distinguish between metadata and base parameters.
*
function __construct($guid = null) {
$this->initializeAttributes();
+ // compatibility for 1.7 api.
+ $this->initialise_attributes(false);
+
if (!empty($guid)) {
// Is $guid is a DB row - either a entity row, or a user table row.
if ($guid instanceof stdClass) {