Source of file AbstractSegmentFieldModifier.php
Size: 1,834 Bytes - Last Modified: 2021-12-23T10:34:13+00:00
/var/www/docs.ssmods.com/process/src/src/SegmentFieldModifier/AbstractSegmentFieldModifier.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 | <?php namespace SilverStripe\Forms\SegmentFieldModifier; use ReflectionClass; use SilverStripe\Forms\SegmentField; use SilverStripe\Forms\SegmentFieldModifier; abstract class AbstractSegmentFieldModifier implements SegmentFieldModifier { public function __construct() { // required so that ReflectionInstance::newInstanceArgs doesn't fail } /** * @var mixed */ protected $form; /** * @var SegmentField */ protected $field; /** * @var mixed */ protected $request; /** * @inheritdoc * * @param mixed $form * * @return $this */ public function setForm($form) { $this->form = $form; return $this; } /** * @return mixed */ public function getForm() { return $this->form; } /** * @inheritdoc * * @param SegmentField $field * * @return $this */ public function setField(SegmentField $field) { $this->field = $field; return $this; } /** * @return SegmentField */ public function getField() { return $this->field; } /** * @inheritdoc * * @param mixed $request * * @return $this */ public function setRequest($request) { $this->request = $request; return $this; } /** * @return mixed */ public function getRequest() { return $this->request; } /** * @return static */ public static function create() { $reflection = new ReflectionClass(get_called_class()); if (func_num_args()) { return $reflection->newInstanceArgs(func_get_args()); } else { return $reflection->newInstance(); } } } |