Total Complexity | 51 |
Total Lines | 627 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Complex classes like DescribeGlobalSObjectResult often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use DescribeGlobalSObjectResult, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
5 | class DescribeGlobalSObjectResult |
||
6 | { |
||
7 | /** |
||
8 | * @var boolean |
||
9 | */ |
||
10 | protected $activateable = null; |
||
11 | |||
12 | /** |
||
13 | * @var boolean |
||
14 | */ |
||
15 | protected $createable = null; |
||
16 | |||
17 | /** |
||
18 | * @var boolean |
||
19 | */ |
||
20 | protected $custom = null; |
||
21 | |||
22 | /** |
||
23 | * @var boolean |
||
24 | */ |
||
25 | protected $customSetting = null; |
||
26 | |||
27 | /** |
||
28 | * @var boolean |
||
29 | */ |
||
30 | protected $dataTranslationEnabled = null; |
||
31 | |||
32 | /** |
||
33 | * @var boolean |
||
34 | */ |
||
35 | protected $deletable = null; |
||
36 | |||
37 | /** |
||
38 | * @var boolean |
||
39 | */ |
||
40 | protected $deprecatedAndHidden = null; |
||
41 | |||
42 | /** |
||
43 | * @var boolean |
||
44 | */ |
||
45 | protected $feedEnabled = null; |
||
46 | |||
47 | /** |
||
48 | * @var boolean |
||
49 | */ |
||
50 | protected $hasSubtypes = null; |
||
51 | |||
52 | /** |
||
53 | * @var boolean |
||
54 | */ |
||
55 | protected $idEnabled = null; |
||
56 | |||
57 | /** |
||
58 | * @var boolean |
||
59 | */ |
||
60 | protected $isSubtype = null; |
||
61 | |||
62 | /** |
||
63 | * @var string |
||
64 | */ |
||
65 | protected $keyPrefix = null; |
||
66 | |||
67 | /** |
||
68 | * @var string |
||
69 | */ |
||
70 | protected $label = null; |
||
71 | |||
72 | /** |
||
73 | * @var string |
||
74 | */ |
||
75 | protected $labelPlural = null; |
||
76 | |||
77 | /** |
||
78 | * @var boolean |
||
79 | */ |
||
80 | protected $layoutable = null; |
||
81 | |||
82 | /** |
||
83 | * @var boolean |
||
84 | */ |
||
85 | protected $mergeable = null; |
||
86 | |||
87 | /** |
||
88 | * @var boolean |
||
89 | */ |
||
90 | protected $mruEnabled = null; |
||
91 | |||
92 | /** |
||
93 | * @var string |
||
94 | */ |
||
95 | protected $name = null; |
||
96 | |||
97 | /** |
||
98 | * @var boolean |
||
99 | */ |
||
100 | protected $queryable = null; |
||
101 | |||
102 | /** |
||
103 | * @var boolean |
||
104 | */ |
||
105 | protected $replicateable = null; |
||
106 | |||
107 | /** |
||
108 | * @var boolean |
||
109 | */ |
||
110 | protected $retrieveable = null; |
||
111 | |||
112 | /** |
||
113 | * @var boolean |
||
114 | */ |
||
115 | protected $searchable = null; |
||
116 | |||
117 | /** |
||
118 | * @var boolean |
||
119 | */ |
||
120 | protected $triggerable = null; |
||
121 | |||
122 | /** |
||
123 | * @var boolean |
||
124 | */ |
||
125 | protected $undeletable = null; |
||
126 | |||
127 | /** |
||
128 | * @var boolean |
||
129 | */ |
||
130 | protected $updateable = null; |
||
131 | |||
132 | /** |
||
133 | * @param boolean $activateable |
||
134 | * @param boolean $createable |
||
135 | * @param boolean $custom |
||
136 | * @param boolean $customSetting |
||
137 | * @param boolean $deletable |
||
138 | * @param boolean $deprecatedAndHidden |
||
139 | * @param boolean $feedEnabled |
||
140 | * @param boolean $hasSubtypes |
||
141 | * @param boolean $idEnabled |
||
142 | * @param boolean $isSubtype |
||
143 | * @param string $label |
||
144 | * @param string $labelPlural |
||
145 | * @param boolean $layoutable |
||
146 | * @param boolean $mergeable |
||
147 | * @param boolean $mruEnabled |
||
148 | * @param string $name |
||
149 | * @param boolean $queryable |
||
150 | * @param boolean $replicateable |
||
151 | * @param boolean $retrieveable |
||
152 | * @param boolean $searchable |
||
153 | * @param boolean $triggerable |
||
154 | * @param boolean $undeletable |
||
155 | * @param boolean $updateable |
||
156 | */ |
||
157 | public function __construct($activateable = null, $createable = null, $custom = null, $customSetting = null, $deletable = null, $deprecatedAndHidden = null, $feedEnabled = null, $hasSubtypes = null, $idEnabled = null, $isSubtype = null, $label = null, $labelPlural = null, $layoutable = null, $mergeable = null, $mruEnabled = null, $name = null, $queryable = null, $replicateable = null, $retrieveable = null, $searchable = null, $triggerable = null, $undeletable = null, $updateable = null) |
||
158 | { |
||
159 | $this->activateable = $activateable; |
||
160 | $this->createable = $createable; |
||
161 | $this->custom = $custom; |
||
162 | $this->customSetting = $customSetting; |
||
163 | $this->deletable = $deletable; |
||
164 | $this->deprecatedAndHidden = $deprecatedAndHidden; |
||
165 | $this->feedEnabled = $feedEnabled; |
||
166 | $this->hasSubtypes = $hasSubtypes; |
||
167 | $this->idEnabled = $idEnabled; |
||
168 | $this->isSubtype = $isSubtype; |
||
169 | $this->label = $label; |
||
170 | $this->labelPlural = $labelPlural; |
||
171 | $this->layoutable = $layoutable; |
||
172 | $this->mergeable = $mergeable; |
||
173 | $this->mruEnabled = $mruEnabled; |
||
174 | $this->name = $name; |
||
175 | $this->queryable = $queryable; |
||
176 | $this->replicateable = $replicateable; |
||
177 | $this->retrieveable = $retrieveable; |
||
178 | $this->searchable = $searchable; |
||
179 | $this->triggerable = $triggerable; |
||
180 | $this->undeletable = $undeletable; |
||
181 | $this->updateable = $updateable; |
||
182 | } |
||
183 | |||
184 | /** |
||
185 | * @return boolean |
||
186 | */ |
||
187 | public function getActivateable() |
||
188 | { |
||
189 | return $this->activateable; |
||
190 | } |
||
191 | |||
192 | /** |
||
193 | * @param boolean $activateable |
||
194 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
195 | */ |
||
196 | public function setActivateable($activateable) |
||
197 | { |
||
198 | $this->activateable = $activateable; |
||
199 | return $this; |
||
200 | } |
||
201 | |||
202 | /** |
||
203 | * @return boolean |
||
204 | */ |
||
205 | public function getCreateable() |
||
206 | { |
||
207 | return $this->createable; |
||
208 | } |
||
209 | |||
210 | /** |
||
211 | * @param boolean $createable |
||
212 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
213 | */ |
||
214 | public function setCreateable($createable) |
||
215 | { |
||
216 | $this->createable = $createable; |
||
217 | return $this; |
||
218 | } |
||
219 | |||
220 | /** |
||
221 | * @return boolean |
||
222 | */ |
||
223 | public function getCustom() |
||
224 | { |
||
225 | return $this->custom; |
||
226 | } |
||
227 | |||
228 | /** |
||
229 | * @param boolean $custom |
||
230 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
231 | */ |
||
232 | public function setCustom($custom) |
||
233 | { |
||
234 | $this->custom = $custom; |
||
235 | return $this; |
||
236 | } |
||
237 | |||
238 | /** |
||
239 | * @return boolean |
||
240 | */ |
||
241 | public function getCustomSetting() |
||
242 | { |
||
243 | return $this->customSetting; |
||
244 | } |
||
245 | |||
246 | /** |
||
247 | * @param boolean $customSetting |
||
248 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
249 | */ |
||
250 | public function setCustomSetting($customSetting) |
||
251 | { |
||
252 | $this->customSetting = $customSetting; |
||
253 | return $this; |
||
254 | } |
||
255 | |||
256 | /** |
||
257 | * @return boolean |
||
258 | */ |
||
259 | public function getDataTranslationEnabled() |
||
260 | { |
||
261 | return $this->dataTranslationEnabled; |
||
262 | } |
||
263 | |||
264 | /** |
||
265 | * @param boolean $dataTranslationEnabled |
||
266 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
267 | */ |
||
268 | public function setDataTranslationEnabled($dataTranslationEnabled) |
||
269 | { |
||
270 | $this->dataTranslationEnabled = $dataTranslationEnabled; |
||
271 | return $this; |
||
272 | } |
||
273 | |||
274 | /** |
||
275 | * @return boolean |
||
276 | */ |
||
277 | public function getDeletable() |
||
278 | { |
||
279 | return $this->deletable; |
||
280 | } |
||
281 | |||
282 | /** |
||
283 | * @param boolean $deletable |
||
284 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
285 | */ |
||
286 | public function setDeletable($deletable) |
||
287 | { |
||
288 | $this->deletable = $deletable; |
||
289 | return $this; |
||
290 | } |
||
291 | |||
292 | /** |
||
293 | * @return boolean |
||
294 | */ |
||
295 | public function getDeprecatedAndHidden() |
||
296 | { |
||
297 | return $this->deprecatedAndHidden; |
||
298 | } |
||
299 | |||
300 | /** |
||
301 | * @param boolean $deprecatedAndHidden |
||
302 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
303 | */ |
||
304 | public function setDeprecatedAndHidden($deprecatedAndHidden) |
||
305 | { |
||
306 | $this->deprecatedAndHidden = $deprecatedAndHidden; |
||
307 | return $this; |
||
308 | } |
||
309 | |||
310 | /** |
||
311 | * @return boolean |
||
312 | */ |
||
313 | public function getFeedEnabled() |
||
314 | { |
||
315 | return $this->feedEnabled; |
||
316 | } |
||
317 | |||
318 | /** |
||
319 | * @param boolean $feedEnabled |
||
320 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
321 | */ |
||
322 | public function setFeedEnabled($feedEnabled) |
||
323 | { |
||
324 | $this->feedEnabled = $feedEnabled; |
||
325 | return $this; |
||
326 | } |
||
327 | |||
328 | /** |
||
329 | * @return boolean |
||
330 | */ |
||
331 | public function getHasSubtypes() |
||
332 | { |
||
333 | return $this->hasSubtypes; |
||
334 | } |
||
335 | |||
336 | /** |
||
337 | * @param boolean $hasSubtypes |
||
338 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
339 | */ |
||
340 | public function setHasSubtypes($hasSubtypes) |
||
341 | { |
||
342 | $this->hasSubtypes = $hasSubtypes; |
||
343 | return $this; |
||
344 | } |
||
345 | |||
346 | /** |
||
347 | * @return boolean |
||
348 | */ |
||
349 | public function getIdEnabled() |
||
350 | { |
||
351 | return $this->idEnabled; |
||
352 | } |
||
353 | |||
354 | /** |
||
355 | * @param boolean $idEnabled |
||
356 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
357 | */ |
||
358 | public function setIdEnabled($idEnabled) |
||
359 | { |
||
360 | $this->idEnabled = $idEnabled; |
||
361 | return $this; |
||
362 | } |
||
363 | |||
364 | /** |
||
365 | * @return boolean |
||
366 | */ |
||
367 | public function getIsSubtype() |
||
368 | { |
||
369 | return $this->isSubtype; |
||
370 | } |
||
371 | |||
372 | /** |
||
373 | * @param boolean $isSubtype |
||
374 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
375 | */ |
||
376 | public function setIsSubtype($isSubtype) |
||
377 | { |
||
378 | $this->isSubtype = $isSubtype; |
||
379 | return $this; |
||
380 | } |
||
381 | |||
382 | /** |
||
383 | * @return string |
||
384 | */ |
||
385 | public function getKeyPrefix() |
||
386 | { |
||
387 | return $this->keyPrefix; |
||
388 | } |
||
389 | |||
390 | /** |
||
391 | * @param string $keyPrefix |
||
392 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
393 | */ |
||
394 | public function setKeyPrefix($keyPrefix) |
||
395 | { |
||
396 | $this->keyPrefix = $keyPrefix; |
||
397 | return $this; |
||
398 | } |
||
399 | |||
400 | /** |
||
401 | * @return string |
||
402 | */ |
||
403 | public function getLabel() |
||
404 | { |
||
405 | return $this->label; |
||
406 | } |
||
407 | |||
408 | /** |
||
409 | * @param string $label |
||
410 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
411 | */ |
||
412 | public function setLabel($label) |
||
413 | { |
||
414 | $this->label = $label; |
||
415 | return $this; |
||
416 | } |
||
417 | |||
418 | /** |
||
419 | * @return string |
||
420 | */ |
||
421 | public function getLabelPlural() |
||
422 | { |
||
423 | return $this->labelPlural; |
||
424 | } |
||
425 | |||
426 | /** |
||
427 | * @param string $labelPlural |
||
428 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
429 | */ |
||
430 | public function setLabelPlural($labelPlural) |
||
431 | { |
||
432 | $this->labelPlural = $labelPlural; |
||
433 | return $this; |
||
434 | } |
||
435 | |||
436 | /** |
||
437 | * @return boolean |
||
438 | */ |
||
439 | public function getLayoutable() |
||
440 | { |
||
441 | return $this->layoutable; |
||
442 | } |
||
443 | |||
444 | /** |
||
445 | * @param boolean $layoutable |
||
446 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
447 | */ |
||
448 | public function setLayoutable($layoutable) |
||
449 | { |
||
450 | $this->layoutable = $layoutable; |
||
451 | return $this; |
||
452 | } |
||
453 | |||
454 | /** |
||
455 | * @return boolean |
||
456 | */ |
||
457 | public function getMergeable() |
||
458 | { |
||
459 | return $this->mergeable; |
||
460 | } |
||
461 | |||
462 | /** |
||
463 | * @param boolean $mergeable |
||
464 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
465 | */ |
||
466 | public function setMergeable($mergeable) |
||
467 | { |
||
468 | $this->mergeable = $mergeable; |
||
469 | return $this; |
||
470 | } |
||
471 | |||
472 | /** |
||
473 | * @return boolean |
||
474 | */ |
||
475 | public function getMruEnabled() |
||
476 | { |
||
477 | return $this->mruEnabled; |
||
478 | } |
||
479 | |||
480 | /** |
||
481 | * @param boolean $mruEnabled |
||
482 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
483 | */ |
||
484 | public function setMruEnabled($mruEnabled) |
||
485 | { |
||
486 | $this->mruEnabled = $mruEnabled; |
||
487 | return $this; |
||
488 | } |
||
489 | |||
490 | /** |
||
491 | * @return string |
||
492 | */ |
||
493 | public function getName() |
||
494 | { |
||
495 | return $this->name; |
||
496 | } |
||
497 | |||
498 | /** |
||
499 | * @param string $name |
||
500 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
501 | */ |
||
502 | public function setName($name) |
||
503 | { |
||
504 | $this->name = $name; |
||
505 | return $this; |
||
506 | } |
||
507 | |||
508 | /** |
||
509 | * @return boolean |
||
510 | */ |
||
511 | public function getQueryable() |
||
512 | { |
||
513 | return $this->queryable; |
||
514 | } |
||
515 | |||
516 | /** |
||
517 | * @param boolean $queryable |
||
518 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
519 | */ |
||
520 | public function setQueryable($queryable) |
||
521 | { |
||
522 | $this->queryable = $queryable; |
||
523 | return $this; |
||
524 | } |
||
525 | |||
526 | /** |
||
527 | * @return boolean |
||
528 | */ |
||
529 | public function getReplicateable() |
||
530 | { |
||
531 | return $this->replicateable; |
||
532 | } |
||
533 | |||
534 | /** |
||
535 | * @param boolean $replicateable |
||
536 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
537 | */ |
||
538 | public function setReplicateable($replicateable) |
||
539 | { |
||
540 | $this->replicateable = $replicateable; |
||
541 | return $this; |
||
542 | } |
||
543 | |||
544 | /** |
||
545 | * @return boolean |
||
546 | */ |
||
547 | public function getRetrieveable() |
||
548 | { |
||
549 | return $this->retrieveable; |
||
550 | } |
||
551 | |||
552 | /** |
||
553 | * @param boolean $retrieveable |
||
554 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
555 | */ |
||
556 | public function setRetrieveable($retrieveable) |
||
557 | { |
||
558 | $this->retrieveable = $retrieveable; |
||
559 | return $this; |
||
560 | } |
||
561 | |||
562 | /** |
||
563 | * @return boolean |
||
564 | */ |
||
565 | public function getSearchable() |
||
566 | { |
||
567 | return $this->searchable; |
||
568 | } |
||
569 | |||
570 | /** |
||
571 | * @param boolean $searchable |
||
572 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
573 | */ |
||
574 | public function setSearchable($searchable) |
||
575 | { |
||
576 | $this->searchable = $searchable; |
||
577 | return $this; |
||
578 | } |
||
579 | |||
580 | /** |
||
581 | * @return boolean |
||
582 | */ |
||
583 | public function getTriggerable() |
||
584 | { |
||
585 | return $this->triggerable; |
||
586 | } |
||
587 | |||
588 | /** |
||
589 | * @param boolean $triggerable |
||
590 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
591 | */ |
||
592 | public function setTriggerable($triggerable) |
||
593 | { |
||
594 | $this->triggerable = $triggerable; |
||
595 | return $this; |
||
596 | } |
||
597 | |||
598 | /** |
||
599 | * @return boolean |
||
600 | */ |
||
601 | public function getUndeletable() |
||
602 | { |
||
603 | return $this->undeletable; |
||
604 | } |
||
605 | |||
606 | /** |
||
607 | * @param boolean $undeletable |
||
608 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
609 | */ |
||
610 | public function setUndeletable($undeletable) |
||
611 | { |
||
612 | $this->undeletable = $undeletable; |
||
613 | return $this; |
||
614 | } |
||
615 | |||
616 | /** |
||
617 | * @return boolean |
||
618 | */ |
||
619 | public function getUpdateable() |
||
622 | } |
||
623 | |||
624 | /** |
||
625 | * @param boolean $updateable |
||
626 | * @return \SForce\Wsdl\DescribeGlobalSObjectResult |
||
627 | */ |
||
628 | public function setUpdateable($updateable) |
||
629 | { |
||
630 | $this->updateable = $updateable; |
||
631 | return $this; |
||
632 | } |
||
633 | } |
||
634 |