From 7547c9320425482fb08c4894a99b7919dd737d32 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:47:10 +1300 Subject: [PATCH] ENH Add a status flag for companies that we can behat test against (#212) --- 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); + } }