@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorCheckboxesEditField
4 extends PhabricatorEditField {
5
6 private $options;
7
8 protected function newControl() {
9 $options = $this->getOptions();
10
11 return id(new AphrontFormCheckboxControl())
12 ->setOptions($options);
13 }
14
15 protected function newConduitParameterType() {
16 return new ConduitStringListParameterType();
17 }
18
19 protected function newHTTPParameterType() {
20 return new AphrontStringListHTTPParameterType();
21 }
22
23 public function setOptions(array $options) {
24 $this->options = $options;
25 return $this;
26 }
27
28 public function getOptions() {
29 if ($this->options === null) {
30 throw new PhutilInvalidStateException('setOptions');
31 }
32
33 return $this->options;
34 }
35
36}