From 0d6572a2d670ee416c5c18b0c03576b99d2955ad Mon Sep 17 00:00:00 2001 From: Jackson Darlow Date: Thu, 11 Jun 2020 17:04:45 +1200 Subject: [PATCH 1/3] Added DocBlocks to DataExtension methods --- src/ORM/DataExtension.php | 73 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/src/ORM/DataExtension.php b/src/ORM/DataExtension.php index 869829b0b..3504c2e1c 100644 --- a/src/ORM/DataExtension.php +++ b/src/ORM/DataExtension.php @@ -16,6 +16,9 @@ use Exception; abstract class DataExtension extends Extension { + /** + * @deprecated No longer used by internal code + */ public static function unload_extra_statics($class, $extension) { throw new Exception('unload_extra_statics gone'); @@ -60,42 +63,112 @@ abstract class DataExtension extends Extension { } + /** + * Extend the owner's onBeforeWrite() logic + * + * See {@link DataObject::onBeforeWrite()} for context. + */ public function onBeforeWrite() { } + /** + * Extend the owner's onAfterWrite() logic + * + * See {@link DataObject::onAfterWrite()} for context. + */ public function onAfterWrite() { } + /** + * Extend the owner's onBeforeDelete() logic + * + * See {@link DataObject::onBeforeDelete()} for context. + */ public function onBeforeDelete() { } + /** + * Extend the owner's onAfterDelete() logic + * + * See {@link DataObject::onAfterDelete()} for context. + */ public function onAfterDelete() { } + /** + * Extend the owner's requireDefaultRecords() logic + * + * See {@link DataObject::requireDefaultRecords()} for context. + */ public function requireDefaultRecords() { } + /** + * Extend the owner's populateDefaults() logic + * + * See {@link DataObject::populateDefaults()} for context. + */ public function populateDefaults() { } + /** + * Influence the owner's can() permission check value to be disallowed (false), + * or allowed (true) if no other processed results are to disallow. + * + * See {@link DataObject::can()} and {@link DataObject::extendedCan()} for context. + * + * @param Member $member + * @param array $context + * @return bool + */ public function can($member) { } + /** + * Influence the owner's canEdit() permission check value to be disallowed (false), + * or allowed (true) if no other processed results are to disallow. + * + * See {@link DataObject::canEdit()} and {@link DataObject::extendedCan()} for context. + * + * @param Member $member + * @param array $context + * @return bool + */ public function canEdit($member) { } + /** + * Influence the owner's canDelete() permission check value to be disallowed (false), + * or allowed (true) if no other processed results are to disallow. + * + * See {@link DataObject::canDelete()} and {@link DataObject::extendedCan()} for context. + * + * @param Member $member + * @param array $context + * @return bool + */ public function canDelete($member) { } + /** + * Influence the owner's canCreate() permission check value to be disallowed (false), + * or allowed (true) if no other processed results are to disallow. + * + * See {@link DataObject::canCreate()} and {@link DataObject::extendedCan()} for context. + * + * @param Member $member + * @param array $context + * @return bool + */ public function canCreate($member) { } From 2175de9560ecfe441bf0d5b547e1f3bb49997b8d Mon Sep 17 00:00:00 2001 From: Jackson Darlow Date: Fri, 12 Jun 2020 10:19:15 +1200 Subject: [PATCH 2/3] Adjusted DataExtension DocBlocks to another degree of detail --- src/ORM/DataExtension.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ORM/DataExtension.php b/src/ORM/DataExtension.php index 3504c2e1c..d1e69cf4b 100644 --- a/src/ORM/DataExtension.php +++ b/src/ORM/DataExtension.php @@ -17,7 +17,7 @@ abstract class DataExtension extends Extension { /** - * @deprecated No longer used by internal code + * @deprecated 4.7.0 No longer used by internal code */ public static function unload_extra_statics($class, $extension) { @@ -119,7 +119,8 @@ abstract class DataExtension extends Extension /** * Influence the owner's can() permission check value to be disallowed (false), - * or allowed (true) if no other processed results are to disallow. + * allowed (true) if no other processed results are to disallow, or open (null) to not + * affect the outcome. * * See {@link DataObject::can()} and {@link DataObject::extendedCan()} for context. * @@ -133,7 +134,8 @@ abstract class DataExtension extends Extension /** * Influence the owner's canEdit() permission check value to be disallowed (false), - * or allowed (true) if no other processed results are to disallow. + * allowed (true) if no other processed results are to disallow, or open (null) to not + * affect the outcome. * * See {@link DataObject::canEdit()} and {@link DataObject::extendedCan()} for context. * @@ -147,7 +149,8 @@ abstract class DataExtension extends Extension /** * Influence the owner's canDelete() permission check value to be disallowed (false), - * or allowed (true) if no other processed results are to disallow. + * allowed (true) if no other processed results are to disallow, or open (null) to not + * affect the outcome. * * See {@link DataObject::canDelete()} and {@link DataObject::extendedCan()} for context. * @@ -161,7 +164,8 @@ abstract class DataExtension extends Extension /** * Influence the owner's canCreate() permission check value to be disallowed (false), - * or allowed (true) if no other processed results are to disallow. + * allowed (true) if no other processed results are to disallow, or open (null) to not + * affect the outcome. * * See {@link DataObject::canCreate()} and {@link DataObject::extendedCan()} for context. * From dfe8d23ffc10b7b48633077dcb2e812fb0a03cf2 Mon Sep 17 00:00:00 2001 From: Jackson Darlow Date: Fri, 12 Jun 2020 13:45:14 +1200 Subject: [PATCH 3/3] Added extra type-hints to DataExtension DocBlocks --- src/ORM/DataExtension.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ORM/DataExtension.php b/src/ORM/DataExtension.php index d1e69cf4b..9086af45c 100644 --- a/src/ORM/DataExtension.php +++ b/src/ORM/DataExtension.php @@ -126,7 +126,7 @@ abstract class DataExtension extends Extension * * @param Member $member * @param array $context - * @return bool + * @return bool|null */ public function can($member) { @@ -141,7 +141,7 @@ abstract class DataExtension extends Extension * * @param Member $member * @param array $context - * @return bool + * @return bool|null */ public function canEdit($member) { @@ -156,7 +156,7 @@ abstract class DataExtension extends Extension * * @param Member $member * @param array $context - * @return bool + * @return bool|null */ public function canDelete($member) { @@ -171,7 +171,7 @@ abstract class DataExtension extends Extension * * @param Member $member * @param array $context - * @return bool + * @return bool|null */ public function canCreate($member) {