Total Complexity | 9 |
Total Lines | 187 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class SalesforceContactLog extends DataObject |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * create contact log |
||
10 | * @param string $type |
||
11 | * @param array $fieldsSent |
||
12 | * @param array $filters |
||
13 | * |
||
14 | * @return SalesforceContactLog |
||
15 | */ |
||
16 | public static function create_contact_log($type, array $fieldsSent, array $filters) : SalesforceContactLog |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * returns true if the contact update was successful |
||
34 | * @param mixed $response |
||
35 | * |
||
36 | * @return bool |
||
37 | */ |
||
38 | public function confirmContactLog($response) : bool |
||
39 | { |
||
40 | $id = ''; |
||
41 | $errors = ''; |
||
42 | print_r($response); |
||
43 | die(); |
||
44 | $this->SalesforceIdentifier = $id; |
||
45 | $this->Errors = $errors; |
||
46 | $this->write(); |
||
47 | |||
48 | return $this->hasError(); |
||
49 | } |
||
50 | |||
51 | public function hasError() : bool |
||
52 | { |
||
53 | return $this->SalesforceIdentifier ? false : true; |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * Singular name for CMS |
||
58 | * @var string |
||
59 | */ |
||
60 | private static $singular_name = 'Sales Force Contact Log'; |
||
1 ignored issue
–
show
|
|||
61 | |||
62 | /** |
||
63 | * Plural name for CMS |
||
64 | * @var string |
||
65 | */ |
||
66 | private static $plural_name = 'Sales Force Contact Log Entries'; |
||
1 ignored issue
–
show
|
|||
67 | |||
68 | /** |
||
69 | * SS4 prep! |
||
70 | * @var string |
||
71 | */ |
||
72 | private static $table_name = 'SalesforceContactLog'; |
||
1 ignored issue
–
show
|
|||
73 | |||
74 | private static $db = [ |
||
1 ignored issue
–
show
|
|||
75 | 'SalesforceIdentifier' => 'Varchar(40)', |
||
76 | 'Type' => 'Enum("Created,Updated")', |
||
77 | 'FieldsSent' => 'Text', |
||
78 | 'Filters' => 'Text', |
||
79 | 'Errors' => 'Text', |
||
80 | ]; |
||
81 | |||
82 | |||
83 | private static $default_sort = [ |
||
1 ignored issue
–
show
|
|||
84 | 'ID' => 'DESC' |
||
85 | ]; |
||
86 | |||
87 | /** |
||
88 | * Defines a default list of filters for the search context |
||
89 | * @var array |
||
90 | */ |
||
91 | private static $searchable_fields = [ |
||
1 ignored issue
–
show
|
|||
92 | 'Type' => 'ExactMatchFilter', |
||
93 | 'SalesforceIdentifier' => 'PartialMatchField', |
||
94 | 'FieldsSent' => 'PartialMatchField', |
||
95 | 'Filters' => 'PartialMatchField', |
||
96 | 'Errors' => 'PartialMatchField', |
||
97 | ]; |
||
98 | |||
99 | /** |
||
100 | * Defines summary fields commonly used in table columns |
||
101 | * as a quick overview of the data for this dataobject |
||
102 | * @var array |
||
103 | */ |
||
104 | private static $summary_fields = [ |
||
1 ignored issue
–
show
|
|||
105 | 'SalesforceIdentifier' => 'SF ID', |
||
106 | 'Type' => 'Type', |
||
107 | 'Errors' => 'Errors' |
||
108 | ]; |
||
109 | |||
110 | private static $indexes = [ |
||
1 ignored issue
–
show
|
|||
111 | 'SalesforceIdentifier' => true |
||
112 | ]; |
||
113 | |||
114 | /** |
||
115 | * CMS Fields |
||
116 | * @return FieldList |
||
117 | */ |
||
118 | public function getCMSFields() |
||
150 | } |
||
151 | |||
152 | /** |
||
153 | * DataObject create permissions |
||
154 | * @param Member $member |
||
155 | * @return bool |
||
156 | */ |
||
157 | public function canCreate($member = null) |
||
158 | { |
||
159 | return false; |
||
160 | } |
||
161 | |||
162 | /** |
||
163 | * DataObject edit permissions |
||
164 | * @param Member $member |
||
165 | * @return bool |
||
166 | */ |
||
167 | public function canEdit($member = null) |
||
168 | { |
||
169 | return false; |
||
170 | } |
||
171 | |||
172 | /** |
||
173 | * DataObject delete permissions |
||
174 | * @param Member $member |
||
175 | * @return bool |
||
176 | */ |
||
177 | public function canDelete($member = null) |
||
178 | { |
||
179 | return false; |
||
180 | } |
||
181 | |||
182 | /** |
||
183 | * |
||
184 | * @param string $serializedString (serialised data) |
||
185 | * @return string (html) |
||
186 | */ |
||
187 | protected function serializedToHTML($serializedString) |
||
192 | } |
||
193 | |||
194 | } |
||
195 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.