From 5c9205748a340215239dc145a116c347b3997245 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 20 Nov 2024 15:36:57 +1300 Subject: [PATCH] ENH Add a status flag for companies that we can behat test against --- code/Company.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/Company.php b/code/Company.php index c082b58..552f6b2 100644 --- a/code/Company.php +++ b/code/Company.php @@ -368,4 +368,15 @@ public function scaffoldSearchField() return DropdownField::create('CompanyID', 'Company', Company::get()->map())->setEmptyString(''); } + public function getStatusFlags(bool $cached = true): array + { + $this->beforeExtending('updateStatusFlags', function (array &$flags) { + $flags['company-status-flag1'] = 'string-flag'; + $flags['company-status-flag2'] = [ + 'title' => 'a flag with a title', + 'text' => 'array-flag', + ]; + }); + return parent::getStatusFlags($cached); + } }