Skip to content

Commit 4aec9c3

Browse files
authored
Merge pull request #34 from eversign/add-support-for-checkboxgroup
added missing field for checkboxGroup
2 parents 56d275c + bd6f402 commit 4aec9c3

File tree

3 files changed

+66
-1
lines changed

3 files changed

+66
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ example/*.pdf
66
.DS_Store
77
example/config.php
88
.idea/
9+
.vscode/

sdk/Eversign/CheckboxGroupField.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
3+
/*
4+
* The MIT License
5+
*
6+
* Copyright 2020 Eversign.
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
namespace Eversign;
28+
29+
use Eversign\CheckboxField;
30+
use JMS\Serializer\Annotation\Type;
31+
32+
/**
33+
* Radio Button fields come with a fixed pixel width and height of 14x14.
34+
* The additional group parameter is used to identify radio button groups
35+
*
36+
* @author Alex K.
37+
*/
38+
class CheckboxGroupField extends CheckboxField {
39+
40+
/**
41+
* This parameter is used to identify CheckboxGroup button groups.
42+
* CheckboxGroupFields belonging to the same group must carry the same group parameter.
43+
* @var integer $group
44+
* @Type("integer")
45+
*/
46+
private $group;
47+
48+
public function __construct() {
49+
parent::__construct();
50+
$this->setGroup(0);
51+
}
52+
53+
public function getGroup() {
54+
return $this->group;
55+
}
56+
57+
public function setGroup($group) {
58+
$this->group = $group;
59+
}
60+
61+
62+
63+
}

sdk/Eversign/FormField.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
* "checkbox": "Eversign\CheckboxField",
4747
* "radio": "Eversign\RadioField",
4848
* "dropdown": "Eversign\DropdownField",
49-
* "attachment": "Eversign\AttachmentField"
49+
* "attachment": "Eversign\AttachmentField",
50+
* "checkboxGroup": "Eversign\CheckboxGroupField"
5051
*
5152
* })
5253
*/

0 commit comments

Comments
 (0)