From faf079af4ddc0f35fc2b5835c20f184b4c93e303 Mon Sep 17 00:00:00 2001 From: brettp Date: Sat, 20 Nov 2010 17:41:50 +0000 Subject: Fixes #2629: Pulled old initialise_attributes() into ElggData and added a default param to emit a deprecation notice if called. git-svn-id: http://code.elgg.org/elgg/trunk@7387 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggData.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'engine/classes/ElggData.php') diff --git a/engine/classes/ElggData.php b/engine/classes/ElggData.php index a904cb923..2853a5298 100644 --- a/engine/classes/ElggData.php +++ b/engine/classes/ElggData.php @@ -23,6 +23,27 @@ abstract class ElggData implements */ 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. * -- cgit v1.2.3