| Total Complexity | 74 |
| Total Lines | 1094 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
Complex classes like CLp 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 CLp, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 22 | class CLp extends AbstractResource implements ResourceInterface |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * @var int |
||
| 26 | * |
||
| 27 | * @ORM\Column(name="iid", type="integer") |
||
| 28 | * @ORM\Id |
||
| 29 | * @ORM\GeneratedValue |
||
| 30 | */ |
||
| 31 | protected $iid; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var int |
||
| 35 | * |
||
| 36 | * @ORM\Column(name="c_id", type="integer") |
||
| 37 | */ |
||
| 38 | protected $cId; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @var int |
||
| 42 | * |
||
| 43 | * @ORM\Column(name="lp_type", type="integer", nullable=false) |
||
| 44 | */ |
||
| 45 | protected $lpType; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @var string |
||
| 49 | * @Assert\NotBlank() |
||
| 50 | * @ORM\Column(name="name", type="string", length=255, nullable=false) |
||
| 51 | */ |
||
| 52 | protected $name; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @var string |
||
| 56 | * |
||
| 57 | * @ORM\Column(name="ref", type="text", nullable=true) |
||
| 58 | */ |
||
| 59 | protected $ref; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @var string |
||
| 63 | * |
||
| 64 | * @ORM\Column(name="description", type="text", nullable=true) |
||
| 65 | */ |
||
| 66 | protected $description; |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @var string |
||
| 70 | * |
||
| 71 | * @ORM\Column(name="path", type="text", nullable=false) |
||
| 72 | */ |
||
| 73 | protected $path; |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @var bool |
||
| 77 | * |
||
| 78 | * @ORM\Column(name="force_commit", type="boolean", nullable=false) |
||
| 79 | */ |
||
| 80 | protected $forceCommit; |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @var string |
||
| 84 | * |
||
| 85 | * @ORM\Column(name="default_view_mod", type="string", length=32, nullable=false, options={"default":"embedded"}) |
||
| 86 | */ |
||
| 87 | protected $defaultViewMod; |
||
| 88 | |||
| 89 | /** |
||
| 90 | * @var string |
||
| 91 | * |
||
| 92 | * @ORM\Column(name="default_encoding", type="string", length=32, nullable=false, options={"default":"UTF-8"}) |
||
| 93 | */ |
||
| 94 | protected $defaultEncoding; |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @var int |
||
| 98 | * |
||
| 99 | * @ORM\Column(name="display_order", type="integer", nullable=false, options={"default":"0"}) |
||
| 100 | */ |
||
| 101 | protected $displayOrder; |
||
| 102 | |||
| 103 | /** |
||
| 104 | * @var string |
||
| 105 | * |
||
| 106 | * @ORM\Column(name="content_maker", type="text", nullable=false) |
||
| 107 | */ |
||
| 108 | protected $contentMaker; |
||
| 109 | |||
| 110 | /** |
||
| 111 | * @var string |
||
| 112 | * |
||
| 113 | * @ORM\Column(name="content_local", type="string", length=32, nullable=false, options={"default":"local"}) |
||
| 114 | */ |
||
| 115 | protected $contentLocal; |
||
| 116 | |||
| 117 | /** |
||
| 118 | * @var string |
||
| 119 | * |
||
| 120 | * @ORM\Column(name="content_license", type="text", nullable=false) |
||
| 121 | */ |
||
| 122 | protected $contentLicense; |
||
| 123 | |||
| 124 | /** |
||
| 125 | * @var bool |
||
| 126 | * |
||
| 127 | * @ORM\Column(name="prevent_reinit", type="boolean", nullable=false, options={"default":"1"}) |
||
| 128 | */ |
||
| 129 | protected $preventReinit; |
||
| 130 | |||
| 131 | /** |
||
| 132 | * @var string |
||
| 133 | * |
||
| 134 | * @ORM\Column(name="js_lib", type="text", nullable=false) |
||
| 135 | */ |
||
| 136 | protected $jsLib; |
||
| 137 | |||
| 138 | /** |
||
| 139 | * @var bool |
||
| 140 | * |
||
| 141 | * @ORM\Column(name="debug", type="boolean", nullable=false) |
||
| 142 | */ |
||
| 143 | protected $debug; |
||
| 144 | |||
| 145 | /** |
||
| 146 | * @var string |
||
| 147 | * |
||
| 148 | * @ORM\Column(name="theme", type="string", length=255, nullable=false) |
||
| 149 | */ |
||
| 150 | protected $theme; |
||
| 151 | |||
| 152 | /** |
||
| 153 | * @var string |
||
| 154 | * |
||
| 155 | * @ORM\Column(name="preview_image", type="string", length=255, nullable=false) |
||
| 156 | */ |
||
| 157 | protected $previewImage; |
||
| 158 | |||
| 159 | /** |
||
| 160 | * @var string |
||
| 161 | * |
||
| 162 | * @ORM\Column(name="author", type="text", nullable=false) |
||
| 163 | */ |
||
| 164 | protected $author; |
||
| 165 | |||
| 166 | /** |
||
| 167 | * @var int |
||
| 168 | * |
||
| 169 | * @ORM\Column(name="session_id", type="integer", nullable=false) |
||
| 170 | */ |
||
| 171 | protected $sessionId; |
||
| 172 | |||
| 173 | /** |
||
| 174 | * @var int |
||
| 175 | * |
||
| 176 | * @ORM\Column(name="prerequisite", type="integer", nullable=false) |
||
| 177 | */ |
||
| 178 | protected $prerequisite; |
||
| 179 | |||
| 180 | /** |
||
| 181 | * @var bool |
||
| 182 | * |
||
| 183 | * @ORM\Column(name="hide_toc_frame", type="boolean", nullable=false) |
||
| 184 | */ |
||
| 185 | protected $hideTocFrame; |
||
| 186 | |||
| 187 | /** |
||
| 188 | * @var bool |
||
| 189 | * |
||
| 190 | * @ORM\Column(name="seriousgame_mode", type="boolean", nullable=false) |
||
| 191 | */ |
||
| 192 | protected $seriousgameMode; |
||
| 193 | |||
| 194 | /** |
||
| 195 | * @var int |
||
| 196 | * |
||
| 197 | * @ORM\Column(name="use_max_score", type="integer", nullable=false, options={"default":"1"}) |
||
| 198 | */ |
||
| 199 | protected $useMaxScore; |
||
| 200 | |||
| 201 | /** |
||
| 202 | * @var int |
||
| 203 | * |
||
| 204 | * @ORM\Column(name="autolaunch", type="integer", nullable=false) |
||
| 205 | */ |
||
| 206 | protected $autolaunch; |
||
| 207 | |||
| 208 | /** |
||
| 209 | * @var CLpCategory|null |
||
| 210 | * |
||
| 211 | * @ORM\ManyToOne(targetEntity="Chamilo\CourseBundle\Entity\CLpCategory", inversedBy="lps") |
||
| 212 | * @ORM\JoinColumn(name="category_id", referencedColumnName="iid") |
||
| 213 | */ |
||
| 214 | protected $category; |
||
| 215 | |||
| 216 | /** |
||
| 217 | * @var int |
||
| 218 | * |
||
| 219 | * @ORM\Column(name="max_attempts", type="integer", nullable=false) |
||
| 220 | */ |
||
| 221 | protected $maxAttempts; |
||
| 222 | |||
| 223 | /** |
||
| 224 | * @var int |
||
| 225 | * |
||
| 226 | * @ORM\Column(name="subscribe_users", type="integer", nullable=false) |
||
| 227 | */ |
||
| 228 | protected $subscribeUsers; |
||
| 229 | |||
| 230 | /** |
||
| 231 | * @var \DateTime |
||
| 232 | * |
||
| 233 | * @Gedmo\Timestampable(on="create") |
||
| 234 | * |
||
| 235 | * @ORM\Column(name="created_on", type="datetime", nullable=false) |
||
| 236 | */ |
||
| 237 | protected $createdOn; |
||
| 238 | |||
| 239 | /** |
||
| 240 | * @var \DateTime |
||
| 241 | * |
||
| 242 | * @Gedmo\Timestampable(on="update") |
||
| 243 | * |
||
| 244 | * @ORM\Column(name="modified_on", type="datetime", nullable=false) |
||
| 245 | */ |
||
| 246 | protected $modifiedOn; |
||
| 247 | |||
| 248 | /** |
||
| 249 | * @var \DateTime |
||
| 250 | * |
||
| 251 | * @ORM\Column(name="publicated_on", type="datetime", nullable=true) |
||
| 252 | */ |
||
| 253 | protected $publicatedOn; |
||
| 254 | |||
| 255 | /** |
||
| 256 | * @var \DateTime |
||
| 257 | * |
||
| 258 | * @ORM\Column(name="expired_on", type="datetime", nullable=true) |
||
| 259 | */ |
||
| 260 | protected $expiredOn; |
||
| 261 | |||
| 262 | /** |
||
| 263 | * @var int |
||
| 264 | * |
||
| 265 | * @ORM\Column(name="accumulate_scorm_time", type="integer", nullable=false, options={"default":1}) |
||
| 266 | */ |
||
| 267 | protected $accumulateScormTime; |
||
| 268 | |||
| 269 | /** |
||
| 270 | * @var int |
||
| 271 | * |
||
| 272 | * @ORM\Column(name="accumulate_work_time", type="integer", nullable=false, options={"default":0}) |
||
| 273 | */ |
||
| 274 | protected $accumulateWorkTime; |
||
| 275 | |||
| 276 | /** |
||
| 277 | * @var CLpItem[] |
||
| 278 | * |
||
| 279 | * @ORM\OneToMany(targetEntity="CLpItem", mappedBy="lp", cascade={"persist", "remove"}, orphanRemoval=true) |
||
| 280 | */ |
||
| 281 | protected $items; |
||
| 282 | |||
| 283 | /** |
||
| 284 | * @var CForumForum |
||
| 285 | * @ORM\OneToOne(targetEntity="Chamilo\CourseBundle\Entity\CForumForum", mappedBy="lp") |
||
| 286 | */ |
||
| 287 | protected $forum; |
||
| 288 | |||
| 289 | public function __construct() |
||
| 290 | { |
||
| 291 | $this->accumulateScormTime = 1; |
||
| 292 | $this->accumulateWorkTime = 0; |
||
| 293 | $this->author = ''; |
||
| 294 | $this->autolaunch = 0; |
||
| 295 | $this->contentLocal = 'local'; |
||
| 296 | $this->contentMaker = 'chamilo'; |
||
| 297 | $this->contentLicense = ''; |
||
| 298 | $this->createdOn = new \DateTime(); |
||
| 299 | $this->modifiedOn = new \DateTime(); |
||
| 300 | $this->defaultEncoding = 'UTF-8'; |
||
| 301 | $this->defaultViewMod = 'embedded'; |
||
| 302 | $this->description = ''; |
||
| 303 | $this->displayOrder = 0; |
||
| 304 | $this->debug = 0; |
||
|
|
|||
| 305 | $this->forceCommit = 0; |
||
| 306 | $this->hideTocFrame = 0; |
||
| 307 | $this->jsLib = ''; |
||
| 308 | $this->maxAttempts = 0; |
||
| 309 | $this->preventReinit = true; |
||
| 310 | $this->path = ''; |
||
| 311 | $this->prerequisite = 0; |
||
| 312 | $this->previewImage = ''; |
||
| 313 | $this->publicatedOn = new \DateTime(); |
||
| 314 | $this->seriousgameMode = 0; |
||
| 315 | $this->subscribeUsers = 0; |
||
| 316 | $this->useMaxScore = 1; |
||
| 317 | $this->theme = ''; |
||
| 318 | $this->items = new ArrayCollection(); |
||
| 319 | } |
||
| 320 | |||
| 321 | public function __toString(): string |
||
| 322 | { |
||
| 323 | return $this->getName(); |
||
| 324 | } |
||
| 325 | |||
| 326 | /** |
||
| 327 | * Set lpType. |
||
| 328 | * |
||
| 329 | * @param int $lpType |
||
| 330 | * |
||
| 331 | * @return CLp |
||
| 332 | */ |
||
| 333 | public function setLpType($lpType) |
||
| 334 | { |
||
| 335 | $this->lpType = $lpType; |
||
| 336 | |||
| 337 | return $this; |
||
| 338 | } |
||
| 339 | |||
| 340 | /** |
||
| 341 | * Get lpType. |
||
| 342 | * |
||
| 343 | * @return int |
||
| 344 | */ |
||
| 345 | public function getLpType() |
||
| 346 | { |
||
| 347 | return $this->lpType; |
||
| 348 | } |
||
| 349 | |||
| 350 | /** |
||
| 351 | * Set name. |
||
| 352 | * |
||
| 353 | * @param string $name |
||
| 354 | * |
||
| 355 | * @return CLp |
||
| 356 | */ |
||
| 357 | public function setName($name) |
||
| 358 | { |
||
| 359 | $this->name = $name; |
||
| 360 | |||
| 361 | return $this; |
||
| 362 | } |
||
| 363 | |||
| 364 | /** |
||
| 365 | * Get name. |
||
| 366 | * |
||
| 367 | * @return string |
||
| 368 | */ |
||
| 369 | public function getName() |
||
| 370 | { |
||
| 371 | return (string) $this->name; |
||
| 372 | } |
||
| 373 | |||
| 374 | /** |
||
| 375 | * Set ref. |
||
| 376 | * |
||
| 377 | * @param string $ref |
||
| 378 | * |
||
| 379 | * @return CLp |
||
| 380 | */ |
||
| 381 | public function setRef($ref) |
||
| 382 | { |
||
| 383 | $this->ref = $ref; |
||
| 384 | |||
| 385 | return $this; |
||
| 386 | } |
||
| 387 | |||
| 388 | /** |
||
| 389 | * Get ref. |
||
| 390 | * |
||
| 391 | * @return string |
||
| 392 | */ |
||
| 393 | public function getRef() |
||
| 394 | { |
||
| 395 | return $this->ref; |
||
| 396 | } |
||
| 397 | |||
| 398 | /** |
||
| 399 | * Set description. |
||
| 400 | * |
||
| 401 | * @param string $description |
||
| 402 | * |
||
| 403 | * @return CLp |
||
| 404 | */ |
||
| 405 | public function setDescription($description) |
||
| 406 | { |
||
| 407 | $this->description = $description; |
||
| 408 | |||
| 409 | return $this; |
||
| 410 | } |
||
| 411 | |||
| 412 | /** |
||
| 413 | * Get description. |
||
| 414 | * |
||
| 415 | * @return string |
||
| 416 | */ |
||
| 417 | public function getDescription() |
||
| 418 | { |
||
| 419 | return $this->description; |
||
| 420 | } |
||
| 421 | |||
| 422 | /** |
||
| 423 | * Set path. |
||
| 424 | * |
||
| 425 | * @param string $path |
||
| 426 | * |
||
| 427 | * @return CLp |
||
| 428 | */ |
||
| 429 | public function setPath($path) |
||
| 430 | { |
||
| 431 | $this->path = $path; |
||
| 432 | |||
| 433 | return $this; |
||
| 434 | } |
||
| 435 | |||
| 436 | /** |
||
| 437 | * Get path. |
||
| 438 | * |
||
| 439 | * @return string |
||
| 440 | */ |
||
| 441 | public function getPath() |
||
| 442 | { |
||
| 443 | return $this->path; |
||
| 444 | } |
||
| 445 | |||
| 446 | /** |
||
| 447 | * Set forceCommit. |
||
| 448 | * |
||
| 449 | * @param bool $forceCommit |
||
| 450 | * |
||
| 451 | * @return CLp |
||
| 452 | */ |
||
| 453 | public function setForceCommit($forceCommit) |
||
| 454 | { |
||
| 455 | $this->forceCommit = $forceCommit; |
||
| 456 | |||
| 457 | return $this; |
||
| 458 | } |
||
| 459 | |||
| 460 | /** |
||
| 461 | * Get forceCommit. |
||
| 462 | * |
||
| 463 | * @return bool |
||
| 464 | */ |
||
| 465 | public function getForceCommit() |
||
| 466 | { |
||
| 467 | return $this->forceCommit; |
||
| 468 | } |
||
| 469 | |||
| 470 | /** |
||
| 471 | * Set defaultViewMod. |
||
| 472 | * |
||
| 473 | * @param string $defaultViewMod |
||
| 474 | * |
||
| 475 | * @return CLp |
||
| 476 | */ |
||
| 477 | public function setDefaultViewMod($defaultViewMod) |
||
| 478 | { |
||
| 479 | $this->defaultViewMod = $defaultViewMod; |
||
| 480 | |||
| 481 | return $this; |
||
| 482 | } |
||
| 483 | |||
| 484 | /** |
||
| 485 | * Get defaultViewMod. |
||
| 486 | * |
||
| 487 | * @return string |
||
| 488 | */ |
||
| 489 | public function getDefaultViewMod() |
||
| 490 | { |
||
| 491 | return $this->defaultViewMod; |
||
| 492 | } |
||
| 493 | |||
| 494 | /** |
||
| 495 | * Set defaultEncoding. |
||
| 496 | * |
||
| 497 | * @param string $defaultEncoding |
||
| 498 | * |
||
| 499 | * @return CLp |
||
| 500 | */ |
||
| 501 | public function setDefaultEncoding($defaultEncoding) |
||
| 502 | { |
||
| 503 | $this->defaultEncoding = $defaultEncoding; |
||
| 504 | |||
| 505 | return $this; |
||
| 506 | } |
||
| 507 | |||
| 508 | /** |
||
| 509 | * Get defaultEncoding. |
||
| 510 | * |
||
| 511 | * @return string |
||
| 512 | */ |
||
| 513 | public function getDefaultEncoding() |
||
| 514 | { |
||
| 515 | return $this->defaultEncoding; |
||
| 516 | } |
||
| 517 | |||
| 518 | /** |
||
| 519 | * Set displayOrder. |
||
| 520 | * |
||
| 521 | * @param int $displayOrder |
||
| 522 | * |
||
| 523 | * @return CLp |
||
| 524 | */ |
||
| 525 | public function setDisplayOrder($displayOrder) |
||
| 530 | } |
||
| 531 | |||
| 532 | /** |
||
| 533 | * Get displayOrder. |
||
| 534 | * |
||
| 535 | * @return int |
||
| 536 | */ |
||
| 537 | public function getDisplayOrder() |
||
| 538 | { |
||
| 539 | return $this->displayOrder; |
||
| 540 | } |
||
| 541 | |||
| 542 | /** |
||
| 543 | * Set contentMaker. |
||
| 544 | * |
||
| 545 | * @param string $contentMaker |
||
| 546 | * |
||
| 547 | * @return CLp |
||
| 548 | */ |
||
| 549 | public function setContentMaker($contentMaker) |
||
| 550 | { |
||
| 551 | $this->contentMaker = $contentMaker; |
||
| 552 | |||
| 553 | return $this; |
||
| 554 | } |
||
| 555 | |||
| 556 | /** |
||
| 557 | * Get contentMaker. |
||
| 558 | * |
||
| 559 | * @return string |
||
| 560 | */ |
||
| 561 | public function getContentMaker() |
||
| 562 | { |
||
| 563 | return $this->contentMaker; |
||
| 564 | } |
||
| 565 | |||
| 566 | /** |
||
| 567 | * Set contentLocal. |
||
| 568 | * |
||
| 569 | * @param string $contentLocal |
||
| 570 | * |
||
| 571 | * @return CLp |
||
| 572 | */ |
||
| 573 | public function setContentLocal($contentLocal) |
||
| 574 | { |
||
| 575 | $this->contentLocal = $contentLocal; |
||
| 576 | |||
| 577 | return $this; |
||
| 578 | } |
||
| 579 | |||
| 580 | /** |
||
| 581 | * Get contentLocal. |
||
| 582 | * |
||
| 583 | * @return string |
||
| 584 | */ |
||
| 585 | public function getContentLocal() |
||
| 586 | { |
||
| 587 | return $this->contentLocal; |
||
| 588 | } |
||
| 589 | |||
| 590 | /** |
||
| 591 | * Set contentLicense. |
||
| 592 | * |
||
| 593 | * @param string $contentLicense |
||
| 594 | * |
||
| 595 | * @return CLp |
||
| 596 | */ |
||
| 597 | public function setContentLicense($contentLicense) |
||
| 598 | { |
||
| 599 | $this->contentLicense = $contentLicense; |
||
| 600 | |||
| 601 | return $this; |
||
| 602 | } |
||
| 603 | |||
| 604 | /** |
||
| 605 | * Get contentLicense. |
||
| 606 | * |
||
| 607 | * @return string |
||
| 608 | */ |
||
| 609 | public function getContentLicense() |
||
| 610 | { |
||
| 611 | return $this->contentLicense; |
||
| 612 | } |
||
| 613 | |||
| 614 | /** |
||
| 615 | * Set preventReinit. |
||
| 616 | * |
||
| 617 | * @param bool $preventReinit |
||
| 618 | * |
||
| 619 | * @return CLp |
||
| 620 | */ |
||
| 621 | public function setPreventReinit($preventReinit) |
||
| 622 | { |
||
| 623 | $this->preventReinit = $preventReinit; |
||
| 624 | |||
| 625 | return $this; |
||
| 626 | } |
||
| 627 | |||
| 628 | /** |
||
| 629 | * Get preventReinit. |
||
| 630 | * |
||
| 631 | * @return bool |
||
| 632 | */ |
||
| 633 | public function getPreventReinit() |
||
| 634 | { |
||
| 635 | return $this->preventReinit; |
||
| 636 | } |
||
| 637 | |||
| 638 | /** |
||
| 639 | * Set jsLib. |
||
| 640 | * |
||
| 641 | * @param string $jsLib |
||
| 642 | * |
||
| 643 | * @return CLp |
||
| 644 | */ |
||
| 645 | public function setJsLib($jsLib) |
||
| 646 | { |
||
| 647 | $this->jsLib = $jsLib; |
||
| 648 | |||
| 649 | return $this; |
||
| 650 | } |
||
| 651 | |||
| 652 | /** |
||
| 653 | * Get jsLib. |
||
| 654 | * |
||
| 655 | * @return string |
||
| 656 | */ |
||
| 657 | public function getJsLib() |
||
| 658 | { |
||
| 659 | return $this->jsLib; |
||
| 660 | } |
||
| 661 | |||
| 662 | /** |
||
| 663 | * Set debug. |
||
| 664 | * |
||
| 665 | * @param bool $debug |
||
| 666 | * |
||
| 667 | * @return CLp |
||
| 668 | */ |
||
| 669 | public function setDebug($debug) |
||
| 670 | { |
||
| 671 | $this->debug = $debug; |
||
| 672 | |||
| 673 | return $this; |
||
| 674 | } |
||
| 675 | |||
| 676 | /** |
||
| 677 | * Get debug. |
||
| 678 | * |
||
| 679 | * @return bool |
||
| 680 | */ |
||
| 681 | public function getDebug() |
||
| 682 | { |
||
| 683 | return $this->debug; |
||
| 684 | } |
||
| 685 | |||
| 686 | /** |
||
| 687 | * Set theme. |
||
| 688 | * |
||
| 689 | * @param string $theme |
||
| 690 | * |
||
| 691 | * @return CLp |
||
| 692 | */ |
||
| 693 | public function setTheme($theme) |
||
| 694 | { |
||
| 695 | $this->theme = $theme; |
||
| 696 | |||
| 697 | return $this; |
||
| 698 | } |
||
| 699 | |||
| 700 | /** |
||
| 701 | * Get theme. |
||
| 702 | * |
||
| 703 | * @return string |
||
| 704 | */ |
||
| 705 | public function getTheme() |
||
| 706 | { |
||
| 707 | return $this->theme; |
||
| 708 | } |
||
| 709 | |||
| 710 | /** |
||
| 711 | * Set previewImage. |
||
| 712 | * |
||
| 713 | * @param string $previewImage |
||
| 714 | * |
||
| 715 | * @return CLp |
||
| 716 | */ |
||
| 717 | public function setPreviewImage($previewImage) |
||
| 718 | { |
||
| 719 | $this->previewImage = $previewImage; |
||
| 720 | |||
| 721 | return $this; |
||
| 722 | } |
||
| 723 | |||
| 724 | /** |
||
| 725 | * Get previewImage. |
||
| 726 | * |
||
| 727 | * @return string |
||
| 728 | */ |
||
| 729 | public function getPreviewImage() |
||
| 730 | { |
||
| 731 | return $this->previewImage; |
||
| 732 | } |
||
| 733 | |||
| 734 | /** |
||
| 735 | * Set author. |
||
| 736 | * |
||
| 737 | * @param string $author |
||
| 738 | * |
||
| 739 | * @return CLp |
||
| 740 | */ |
||
| 741 | public function setAuthor($author) |
||
| 742 | { |
||
| 743 | $this->author = $author; |
||
| 744 | |||
| 745 | return $this; |
||
| 746 | } |
||
| 747 | |||
| 748 | /** |
||
| 749 | * Get author. |
||
| 750 | * |
||
| 751 | * @return string |
||
| 752 | */ |
||
| 753 | public function getAuthor() |
||
| 754 | { |
||
| 755 | return $this->author; |
||
| 756 | } |
||
| 757 | |||
| 758 | /** |
||
| 759 | * Set sessionId. |
||
| 760 | * |
||
| 761 | * @param int $sessionId |
||
| 762 | * |
||
| 763 | * @return CLp |
||
| 764 | */ |
||
| 765 | public function setSessionId($sessionId) |
||
| 766 | { |
||
| 767 | $this->sessionId = $sessionId; |
||
| 768 | |||
| 769 | return $this; |
||
| 770 | } |
||
| 771 | |||
| 772 | /** |
||
| 773 | * Get sessionId. |
||
| 774 | * |
||
| 775 | * @return int |
||
| 776 | */ |
||
| 777 | public function getSessionId() |
||
| 778 | { |
||
| 779 | return $this->sessionId; |
||
| 780 | } |
||
| 781 | |||
| 782 | /** |
||
| 783 | * Set prerequisite. |
||
| 784 | * |
||
| 785 | * @param int $prerequisite |
||
| 786 | * |
||
| 787 | * @return CLp |
||
| 788 | */ |
||
| 789 | public function setPrerequisite($prerequisite) |
||
| 790 | { |
||
| 791 | $this->prerequisite = $prerequisite; |
||
| 792 | |||
| 793 | return $this; |
||
| 794 | } |
||
| 795 | |||
| 796 | /** |
||
| 797 | * Get prerequisite. |
||
| 798 | * |
||
| 799 | * @return int |
||
| 800 | */ |
||
| 801 | public function getPrerequisite() |
||
| 802 | { |
||
| 803 | return $this->prerequisite; |
||
| 804 | } |
||
| 805 | |||
| 806 | /** |
||
| 807 | * Set hideTocFrame. |
||
| 808 | * |
||
| 809 | * @param bool $hideTocFrame |
||
| 810 | * |
||
| 811 | * @return CLp |
||
| 812 | */ |
||
| 813 | public function setHideTocFrame($hideTocFrame) |
||
| 814 | { |
||
| 815 | $this->hideTocFrame = $hideTocFrame; |
||
| 816 | |||
| 817 | return $this; |
||
| 818 | } |
||
| 819 | |||
| 820 | /** |
||
| 821 | * Get hideTocFrame. |
||
| 822 | * |
||
| 823 | * @return bool |
||
| 824 | */ |
||
| 825 | public function getHideTocFrame() |
||
| 826 | { |
||
| 827 | return $this->hideTocFrame; |
||
| 828 | } |
||
| 829 | |||
| 830 | /** |
||
| 831 | * Set seriousgameMode. |
||
| 832 | * |
||
| 833 | * @param bool $seriousgameMode |
||
| 834 | * |
||
| 835 | * @return CLp |
||
| 836 | */ |
||
| 837 | public function setSeriousgameMode($seriousgameMode) |
||
| 838 | { |
||
| 839 | $this->seriousgameMode = $seriousgameMode; |
||
| 840 | |||
| 841 | return $this; |
||
| 842 | } |
||
| 843 | |||
| 844 | /** |
||
| 845 | * Get seriousgameMode. |
||
| 846 | * |
||
| 847 | * @return bool |
||
| 848 | */ |
||
| 849 | public function getSeriousgameMode() |
||
| 850 | { |
||
| 851 | return $this->seriousgameMode; |
||
| 852 | } |
||
| 853 | |||
| 854 | /** |
||
| 855 | * Set useMaxScore. |
||
| 856 | * |
||
| 857 | * @param int $useMaxScore |
||
| 858 | * |
||
| 859 | * @return CLp |
||
| 860 | */ |
||
| 861 | public function setUseMaxScore($useMaxScore) |
||
| 862 | { |
||
| 863 | $this->useMaxScore = $useMaxScore; |
||
| 864 | |||
| 865 | return $this; |
||
| 866 | } |
||
| 867 | |||
| 868 | /** |
||
| 869 | * Get useMaxScore. |
||
| 870 | * |
||
| 871 | * @return int |
||
| 872 | */ |
||
| 873 | public function getUseMaxScore() |
||
| 874 | { |
||
| 875 | return $this->useMaxScore; |
||
| 876 | } |
||
| 877 | |||
| 878 | /** |
||
| 879 | * Set autolaunch. |
||
| 880 | * |
||
| 881 | * @param int $autolaunch |
||
| 882 | * |
||
| 883 | * @return CLp |
||
| 884 | */ |
||
| 885 | public function setAutolaunch($autolaunch) |
||
| 886 | { |
||
| 887 | $this->autolaunch = $autolaunch; |
||
| 888 | |||
| 889 | return $this; |
||
| 890 | } |
||
| 891 | |||
| 892 | /** |
||
| 893 | * Get autolaunch. |
||
| 894 | * |
||
| 895 | * @return int |
||
| 896 | */ |
||
| 897 | public function getAutolaunch() |
||
| 898 | { |
||
| 899 | return $this->autolaunch; |
||
| 900 | } |
||
| 901 | |||
| 902 | /** |
||
| 903 | * Set createdOn. |
||
| 904 | * |
||
| 905 | * @param \DateTime $createdOn |
||
| 906 | * |
||
| 907 | * @return CLp |
||
| 908 | */ |
||
| 909 | public function setCreatedOn($createdOn) |
||
| 910 | { |
||
| 911 | $this->createdOn = $createdOn; |
||
| 912 | |||
| 913 | return $this; |
||
| 914 | } |
||
| 915 | |||
| 916 | /** |
||
| 917 | * Get createdOn. |
||
| 918 | * |
||
| 919 | * @return \DateTime |
||
| 920 | */ |
||
| 921 | public function getCreatedOn() |
||
| 922 | { |
||
| 923 | return $this->createdOn; |
||
| 924 | } |
||
| 925 | |||
| 926 | /** |
||
| 927 | * Set modifiedOn. |
||
| 928 | * |
||
| 929 | * @param \DateTime $modifiedOn |
||
| 930 | * |
||
| 931 | * @return CLp |
||
| 932 | */ |
||
| 933 | public function setModifiedOn($modifiedOn) |
||
| 934 | { |
||
| 935 | $this->modifiedOn = $modifiedOn; |
||
| 936 | |||
| 937 | return $this; |
||
| 938 | } |
||
| 939 | |||
| 940 | /** |
||
| 941 | * Get modifiedOn. |
||
| 942 | * |
||
| 943 | * @return \DateTime |
||
| 944 | */ |
||
| 945 | public function getModifiedOn() |
||
| 946 | { |
||
| 947 | return $this->modifiedOn; |
||
| 948 | } |
||
| 949 | |||
| 950 | /** |
||
| 951 | * Set publicatedOn. |
||
| 952 | * |
||
| 953 | * @param \DateTime $publicatedOn |
||
| 954 | * |
||
| 955 | * @return CLp |
||
| 956 | */ |
||
| 957 | public function setPublicatedOn($publicatedOn) |
||
| 958 | { |
||
| 959 | $this->publicatedOn = $publicatedOn; |
||
| 960 | |||
| 961 | return $this; |
||
| 962 | } |
||
| 963 | |||
| 964 | /** |
||
| 965 | * Get publicatedOn. |
||
| 966 | * |
||
| 967 | * @return \DateTime |
||
| 968 | */ |
||
| 969 | public function getPublicatedOn() |
||
| 970 | { |
||
| 971 | return $this->publicatedOn; |
||
| 972 | } |
||
| 973 | |||
| 974 | /** |
||
| 975 | * Set expiredOn. |
||
| 976 | * |
||
| 977 | * @param \DateTime $expiredOn |
||
| 978 | * |
||
| 979 | * @return CLp |
||
| 980 | */ |
||
| 981 | public function setExpiredOn($expiredOn) |
||
| 982 | { |
||
| 983 | $this->expiredOn = $expiredOn; |
||
| 984 | |||
| 985 | return $this; |
||
| 986 | } |
||
| 987 | |||
| 988 | /** |
||
| 989 | * Get expiredOn. |
||
| 990 | * |
||
| 991 | * @return \DateTime |
||
| 992 | */ |
||
| 993 | public function getExpiredOn() |
||
| 994 | { |
||
| 995 | return $this->expiredOn; |
||
| 996 | } |
||
| 997 | |||
| 998 | /** |
||
| 999 | * Set cId. |
||
| 1000 | * |
||
| 1001 | * @param int $cId |
||
| 1002 | * |
||
| 1003 | * @return CLp |
||
| 1004 | */ |
||
| 1005 | public function setCId($cId) |
||
| 1006 | { |
||
| 1007 | $this->cId = $cId; |
||
| 1008 | |||
| 1009 | return $this; |
||
| 1010 | } |
||
| 1011 | |||
| 1012 | /** |
||
| 1013 | * Get cId. |
||
| 1014 | * |
||
| 1015 | * @return int |
||
| 1016 | */ |
||
| 1017 | public function getCId() |
||
| 1018 | { |
||
| 1019 | return $this->cId; |
||
| 1020 | } |
||
| 1021 | |||
| 1022 | public function getCategory() |
||
| 1023 | { |
||
| 1024 | return $this->category; |
||
| 1025 | } |
||
| 1026 | |||
| 1027 | public function setCategory($category) |
||
| 1028 | { |
||
| 1029 | $this->category = $category; |
||
| 1030 | |||
| 1031 | return $this; |
||
| 1032 | } |
||
| 1033 | |||
| 1034 | /** |
||
| 1035 | * @return int |
||
| 1036 | */ |
||
| 1037 | public function getAccumulateScormTime() |
||
| 1038 | { |
||
| 1039 | return $this->accumulateScormTime; |
||
| 1040 | } |
||
| 1041 | |||
| 1042 | /** |
||
| 1043 | * @param int $accumulateScormTime |
||
| 1044 | * |
||
| 1045 | * @return CLp |
||
| 1046 | */ |
||
| 1047 | public function setAccumulateScormTime($accumulateScormTime) |
||
| 1048 | { |
||
| 1049 | $this->accumulateScormTime = $accumulateScormTime; |
||
| 1050 | |||
| 1051 | return $this; |
||
| 1052 | } |
||
| 1053 | |||
| 1054 | public function getAccumulateWorkTime(): int |
||
| 1055 | { |
||
| 1056 | return $this->accumulateWorkTime; |
||
| 1057 | } |
||
| 1058 | |||
| 1059 | public function setAccumulateWorkTime(int $accumulateWorkTime): self |
||
| 1060 | { |
||
| 1061 | $this->accumulateWorkTime = $accumulateWorkTime; |
||
| 1062 | |||
| 1063 | return $this; |
||
| 1064 | } |
||
| 1065 | |||
| 1066 | /** |
||
| 1067 | * Get iid. |
||
| 1068 | * |
||
| 1069 | * @return int |
||
| 1070 | */ |
||
| 1071 | public function getIid() |
||
| 1072 | { |
||
| 1073 | return $this->iid; |
||
| 1074 | } |
||
| 1075 | |||
| 1076 | /** |
||
| 1077 | * Get subscribeUsers. |
||
| 1078 | * |
||
| 1079 | * @return int |
||
| 1080 | */ |
||
| 1081 | public function getSubscribeUsers() |
||
| 1082 | { |
||
| 1083 | return $this->subscribeUsers; |
||
| 1084 | } |
||
| 1085 | |||
| 1086 | public function getForum(): ?CForumForum |
||
| 1087 | { |
||
| 1088 | return $this->forum; |
||
| 1089 | } |
||
| 1090 | |||
| 1091 | public function hasForum(): bool |
||
| 1092 | { |
||
| 1093 | return null !== $this->forum; |
||
| 1094 | } |
||
| 1095 | |||
| 1096 | public function setForum(CForumForum $forum): self |
||
| 1097 | { |
||
| 1098 | $this->forum = $forum; |
||
| 1099 | |||
| 1100 | return $this; |
||
| 1101 | } |
||
| 1102 | |||
| 1103 | public function getResourceIdentifier(): int |
||
| 1106 | } |
||
| 1107 | |||
| 1108 | public function getResourceName(): string |
||
| 1109 | { |
||
| 1110 | return $this->getName(); |
||
| 1111 | } |
||
| 1112 | |||
| 1113 | public function setResourceName(string $name): self |
||
| 1114 | { |
||
| 1115 | return $this->setName($name); |
||
| 1116 | } |
||
| 1117 | } |
||
| 1118 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.