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

This commit is contained in:
Ingo Schommer 2013-04-09 14:58:25 +02:00
parent 1cfc159f1a
commit 14b997eea3
2 changed files with 8 additions and 0 deletions

View File

@ -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 {

View File

@ -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)