dynamic /
silverstripe-jobs
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Dynamic\Jobs\Tests\Extensions; |
||
| 4 | |||
| 5 | use Dynamic\Jobs\Extensions\JobCollectionExtension; |
||
| 6 | use SilverStripe\Dev\TestOnly; |
||
| 7 | use SilverStripe\Forms\Form; |
||
| 8 | use SilverStripe\ORM\ArrayList; |
||
| 9 | use SilverStripe\ORM\DataObject; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Class JobHolderCollectionExtensionTest_Object |
||
| 13 | * @package Dynamic\Jobs\Tests\Extensions |
||
| 14 | */ |
||
| 15 | class JobHolderCollectionExtensionTest_Object extends DataObject implements TestOnly |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Needs its own table (table too long otherwise) |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private static $table_name = 'JobHolderCollectionExtension'; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 23 | |||
| 24 | /** |
||
| 25 | * @var array |
||
| 26 | */ |
||
| 27 | private static $extensions = [ |
||
|
0 ignored issues
–
show
|
|||
| 28 | JobCollectionExtension::class, |
||
| 29 | ]; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param $filter |
||
| 33 | * |
||
| 34 | * @return mixed |
||
| 35 | */ |
||
| 36 | public function getCollectionFilters($filter) |
||
| 37 | { |
||
| 38 | $this->extend('updateCollectionFilters', $filter); |
||
| 39 | |||
| 40 | return $filter; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param Form $form |
||
| 45 | * |
||
| 46 | * @return Form |
||
| 47 | */ |
||
| 48 | public function getCollectionForm(Form $form) |
||
| 49 | { |
||
| 50 | $this->extend('updateCollectionForm', $form); |
||
| 51 | |||
| 52 | return $form; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param ArrayList $collection |
||
| 57 | * |
||
| 58 | * @return ArrayList |
||
| 59 | */ |
||
| 60 | public function getCollectionItems(ArrayList $collection) |
||
| 61 | { |
||
| 62 | $this->extend('updateCollectionItems', $collection); |
||
| 63 | |||
| 64 | return $collection; |
||
| 65 | } |
||
| 66 | } |
||
| 67 |