From c390970e1d3a7c8b7c46a908cbc444bfe52ab583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Werner=20M=2E=20Krau=C3=9F?= Date: Sat, 10 Nov 2018 22:59:48 +0100 Subject: [PATCH] DataExtension: add missing hooks, improve docblocks (WIP) See https://github.com/silverstripe/silverstripe-framework/issues/4376 --- src/ORM/DataExtension.php | 63 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/src/ORM/DataExtension.php b/src/ORM/DataExtension.php index 40a7ecfc1fa..c04866a4656 100644 --- a/src/ORM/DataExtension.php +++ b/src/ORM/DataExtension.php @@ -84,18 +84,34 @@ public function populateDefaults() { } + /** + * @param Member|int $member + * @return bool + */ public function can($member) { } + /** + * @param Member|int $member + * @return bool + */ public function canEdit($member) { } + /** + * @param Member|int $member + * @return bool + */ public function canDelete($member) { } + /** + * @param Member|int $member + * @return bool + */ public function canCreate($member) { } @@ -156,7 +172,7 @@ public function updateCMSActions(FieldList $actions) } /** - * this function is used to provide modifications to the summary fields in CMS + * This function is used to provide modifications to the summary fields in CMS * by the extension * By default, the summaryField() of its owner will merge more fields defined in the extension's * $extra_fields['summary_fields'] @@ -179,7 +195,7 @@ public function updateSummaryFields(&$fields) } /** - * this function is used to provide modifications to the fields labels in CMS + * This function is used to provide modifications to the fields labels in CMS * by the extension * By default, the fieldLabels() of its owner will merge more fields defined in the extension's * $extra_fields['field_labels'] @@ -193,4 +209,47 @@ public function updateFieldLabels(&$labels) $labels = array_merge($labels, $field_labels); } } + + /** + * Update the owner's default searchable fields + * + * @param array $fields + * @return array Array of field names + */ + public function updateSearchableFields($fields) + { + } + + public function updateManyManyComponents(RelationList $list) + { + + } + + /** + * @param array $params + * @return array + */ + public function updateInheritableQueryParams($params) + { + } + + /** + * Return a piece of text to keep DataObject cache keys appropriately specific. + * + * @see Versioned->cacheKeyComponent() + * + * @return string + */ + public function cacheKeyComponent() + { + } + + /** + * flush owner's caches + * + * @return void + */ + public function flushCache() + { + } }