Permalink
Browse files

API Deprecated Object::add_extension() usage (as of 3.2)

  • Loading branch information...
1 parent 1cfc159 commit 14b997eea3c2a541fe842025b4f7ff76bd74fba9 @chillu chillu committed Apr 9, 2013
Showing with 8 additions and 0 deletions.
  1. +7 −0 core/Object.php
  2. +1 −0 docs/en/changelogs/3.1.0.md
View
@@ -446,11 +446,18 @@ public static function has_extension($requiredExtension) {
* 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 {
@@ -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)

0 comments on commit 14b997e

Please sign in to comment.