Updated "Extensions and DataExtensions" Docs

Added a notice to the "Owner" section that will remind developers of the limitations of the owner system when it comes to private and protected properties and methods
This commit is contained in:
Benjamin Blake 2020-01-12 14:47:28 -07:00 committed by GitHub
parent 6229d014e0
commit 74f7606080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,6 +249,10 @@ class MyMemberExtension extends DataExtension
}
```
[notice]
Please note that while you can read protected properties (using `$this->owner->protectedProperty`) you cannot not call protected methods (`$this->owner->protectedMethod()`). You also cannot access any private properties or methods (So this would not work either `$this->owner->privateProperty`).
[/notice]
## Checking to see if an Object has an Extension
To see what extensions are currently enabled on an object, use the [getExtensionInstances()](api:SilverStripe\Core\Extensible::getExtensionInstances()) and