diff --git a/core/Object.php b/core/Object.php index e5130c4e0..f04629a7f 100755 --- a/core/Object.php +++ b/core/Object.php @@ -446,11 +446,18 @@ abstract class Object { * Keep in mind that the extension will only be applied to new * instances, not existing ones (including all instances created through {@link singleton()}). * + * @deprecated 3.2 Use YAML config instead, see + * http://doc.silverstripe.org/framework/en/trunk/reference/dataextension * @param string $class Class that should be extended - has to be a subclass of {@link Object} * @param string $extension Subclass of {@link Extension} with optional parameters * as a string, e.g. "Versioned" or "Translatable('Param')" */ public static function add_extension($classOrExtension, $extension = null) { + Deprecation::notice( + '3.2', + 'Use YAML config instead, see http://doc.silverstripe.org/framework/en/trunk/reference/dataextension' + ); + if(func_num_args() > 1) { $class = $classOrExtension; } else { diff --git a/docs/en/changelogs/3.1.0.md b/docs/en/changelogs/3.1.0.md index 7484f90a5..d788eff3b 100644 --- a/docs/en/changelogs/3.1.0.md +++ b/docs/en/changelogs/3.1.0.md @@ -450,3 +450,4 @@ you can enable those warnings and future-proof your code already. * Hard limit displayed pages in the CMS tree to `500`, and the number of direct children to `250`, to avoid excessive resource usage. Configure through `Hierarchy.node_threshold_total` and ` Hierarchy.node_threshold_leaf`. Set to `0` to show tree unrestricted. + * Deprecated `Object::add_extension()`, use YAML config instead, see [docs](http://doc.silverstripe.org/framework/en/trunk/reference/dataextension) \ No newline at end of file