Bristol SU Support Package
GroupNameIs.php
Go to the documentation of this file.
1 <?php
2 
4 
8 
12 class GroupNameIs extends GroupFilter
13 {
14 
15 
25  public function options(): Form
26  {
27  return \FormSchema\Generator\Form::make()->withField(
28  Field::input('Group Name')->inputType('text')->label('Group Name')
29  ->required(true)->placeholder('Full name of the group')
30  )->getSchema();
31  }
32 
40  public function evaluate($settings): bool
41  {
42  return strtoupper($this->group()->data()->name()) === strtoupper($settings['Group Name']);
43  }
44 
50  public function name()
51  {
52  return 'Group name is exactly';
53  }
54 
60  public function description()
61  {
62  return 'Group name exactly matches the name given';
63  }
64 
70  public function alias()
71  {
72  return 'group_name_is';
73  }
74 }