Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like Session 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. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
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 Session, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 30 | class Session |
||
| 31 | { |
||
| 32 | const VISIBLE = 1; |
||
| 33 | const READ_ONLY = 2; |
||
| 34 | const INVISIBLE = 3; |
||
| 35 | const AVAILABLE = 4; |
||
| 36 | |||
| 37 | const STUDENT = 0; |
||
| 38 | const DRH = 1; |
||
| 39 | const COACH = 2; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @var integer |
||
| 43 | * |
||
| 44 | * @ORM\Column(name="id", type="integer", nullable=false, unique=false) |
||
| 45 | * @ORM\Id |
||
| 46 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 47 | */ |
||
| 48 | private $id; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @var string |
||
| 52 | * |
||
| 53 | * @ORM\Column(name="name", type="string", length=150, nullable=false, unique=false) |
||
| 54 | */ |
||
| 55 | private $name; |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @var string |
||
| 59 | * |
||
| 60 | * @ORM\Column(name="description", type="text", nullable=true, unique=false) |
||
| 61 | */ |
||
| 62 | private $description; |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @var string |
||
| 66 | * |
||
| 67 | * @ORM\Column(name="show_description", type="boolean", nullable=true) |
||
| 68 | */ |
||
| 69 | private $showDescription; |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @var integer |
||
| 73 | * |
||
| 74 | * @ORM\Column(name="duration", type="integer", nullable=true) |
||
| 75 | */ |
||
| 76 | private $duration; |
||
| 77 | |||
| 78 | /** |
||
| 79 | * @var integer |
||
| 80 | * |
||
| 81 | * @ORM\Column(name="nbr_courses", type="smallint", nullable=true, unique=false) |
||
| 82 | */ |
||
| 83 | private $nbrCourses; |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @var integer |
||
| 87 | * |
||
| 88 | * @ORM\Column(name="nbr_users", type="integer", nullable=true, unique=false) |
||
| 89 | */ |
||
| 90 | private $nbrUsers; |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @var integer |
||
| 94 | * |
||
| 95 | * @ORM\Column(name="nbr_classes", type="integer", nullable=true, unique=false) |
||
| 96 | */ |
||
| 97 | private $nbrClasses; |
||
| 98 | |||
| 99 | /** |
||
| 100 | * @var integer |
||
| 101 | * |
||
| 102 | * @ORM\Column(name="session_admin_id", type="integer", nullable=true, unique=false) |
||
| 103 | */ |
||
| 104 | private $sessionAdminId; |
||
| 105 | |||
| 106 | /** |
||
| 107 | * @var integer |
||
| 108 | * |
||
| 109 | * @ORM\Column(name="visibility", type="integer", nullable=false, unique=false) |
||
| 110 | */ |
||
| 111 | private $visibility; |
||
| 112 | |||
| 113 | /** |
||
| 114 | * @var integer |
||
| 115 | * |
||
| 116 | * @ORM\Column(name="promotion_id", type="integer", nullable=true, unique=false) |
||
| 117 | */ |
||
| 118 | private $promotionId; |
||
| 119 | |||
| 120 | /** |
||
| 121 | * @var \DateTime |
||
| 122 | * |
||
| 123 | * @ORM\Column(name="display_start_date", type="datetime", nullable=true, unique=false) |
||
| 124 | */ |
||
| 125 | private $displayStartDate; |
||
| 126 | |||
| 127 | /** |
||
| 128 | * @var \DateTime |
||
| 129 | * |
||
| 130 | * @ORM\Column(name="display_end_date", type="datetime", nullable=true, unique=false) |
||
| 131 | */ |
||
| 132 | private $displayEndDate; |
||
| 133 | |||
| 134 | /** |
||
| 135 | * @var \DateTime |
||
| 136 | * |
||
| 137 | * @ORM\Column(name="access_start_date", type="datetime", nullable=true, unique=false) |
||
| 138 | */ |
||
| 139 | private $accessStartDate; |
||
| 140 | |||
| 141 | /** |
||
| 142 | * @var \DateTime |
||
| 143 | * |
||
| 144 | * @ORM\Column(name="access_end_date", type="datetime", nullable=true, unique=false) |
||
| 145 | */ |
||
| 146 | private $accessEndDate; |
||
| 147 | |||
| 148 | /** |
||
| 149 | * @var \DateTime |
||
| 150 | * |
||
| 151 | * @ORM\Column(name="coach_access_start_date", type="datetime", nullable=true, unique=false) |
||
| 152 | */ |
||
| 153 | private $coachAccessStartDate; |
||
| 154 | |||
| 155 | /** |
||
| 156 | * @var \DateTime |
||
| 157 | * |
||
| 158 | * @ORM\Column(name="coach_access_end_date", type="datetime", nullable=true, unique=false) |
||
| 159 | */ |
||
| 160 | private $coachAccessEndDate; |
||
| 161 | |||
| 162 | /** |
||
| 163 | * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CItemProperty", mappedBy="session") |
||
| 164 | **/ |
||
| 165 | //private $items; |
||
| 166 | |||
| 167 | /** |
||
| 168 | * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", inversedBy="sessionAsGeneralCoach") |
||
| 169 | * @ORM\JoinColumn(name="id_coach", referencedColumnName="id") |
||
| 170 | **/ |
||
| 171 | private $generalCoach; |
||
| 172 | |||
| 173 | /** |
||
| 174 | * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\SessionCategory", inversedBy="session") |
||
| 175 | * @ORM\JoinColumn(name="session_category_id", referencedColumnName="id") |
||
| 176 | **/ |
||
| 177 | private $category; |
||
| 178 | |||
| 179 | /** |
||
| 180 | * @var ArrayCollection |
||
| 181 | * @ORM\OneToMany(targetEntity="SessionRelCourse", mappedBy="session", cascade={"persist"}, orphanRemoval=true) |
||
| 182 | **/ |
||
| 183 | protected $courses; |
||
| 184 | |||
| 185 | /** |
||
| 186 | * @var ArrayCollection |
||
| 187 | * @ORM\OneToMany(targetEntity="SessionRelUser", mappedBy="session", cascade={"persist"}, orphanRemoval=true) |
||
| 188 | **/ |
||
| 189 | protected $users; |
||
| 190 | |||
| 191 | /** |
||
| 192 | * @var ArrayCollection |
||
| 193 | * @ORM\OneToMany(targetEntity="SessionRelCourseRelUser", mappedBy="session", cascade={"persist"}, orphanRemoval=true) |
||
| 194 | **/ |
||
| 195 | protected $userCourseSubscriptions; |
||
| 196 | |||
| 197 | /** |
||
| 198 | * @var Course |
||
| 199 | **/ |
||
| 200 | protected $currentCourse; |
||
| 201 | |||
| 202 | /** |
||
| 203 | * @var boolean |
||
| 204 | * @ORM\Column(name="send_subscription_notification", type="boolean", nullable=false, options={"default":false}) |
||
| 205 | */ |
||
| 206 | private $sendSubscriptionNotification; |
||
| 207 | |||
| 208 | /** |
||
| 209 | * @var ArrayCollection |
||
| 210 | * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CStudentPublication", mappedBy="session", cascade={"persist"}, orphanRemoval=true) |
||
| 211 | */ |
||
| 212 | private $studentPublications; |
||
| 213 | |||
| 214 | /** |
||
| 215 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SkillRelUser", mappedBy="session", cascade={"persist"}) |
||
| 216 | */ |
||
| 217 | protected $issuedSkills; |
||
| 218 | |||
| 219 | /** |
||
| 220 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\AccessUrlRelSession", mappedBy="session", cascade={"persist"}, orphanRemoval=true) |
||
| 221 | **/ |
||
| 222 | protected $urls; |
||
| 223 | |||
| 224 | /** |
||
| 225 | * @var AccessUrl |
||
| 226 | **/ |
||
| 227 | protected $currentUrl; |
||
| 228 | |||
| 229 | /** |
||
| 230 | * Constructor |
||
| 231 | */ |
||
| 232 | public function __construct() |
||
| 256 | |||
| 257 | /** |
||
| 258 | * @return int |
||
| 259 | */ |
||
| 260 | public function getDuration() |
||
| 264 | |||
| 265 | /** |
||
| 266 | * @param int $duration |
||
| 267 | */ |
||
| 268 | public function setDuration($duration) |
||
| 272 | |||
| 273 | /** |
||
| 274 | * @return string |
||
| 275 | */ |
||
| 276 | public function getShowDescription() |
||
| 280 | |||
| 281 | /** |
||
| 282 | * @param string $showDescription |
||
| 283 | * @return $this |
||
| 284 | */ |
||
| 285 | public function setShowDescription($showDescription) |
||
| 291 | |||
| 292 | /** |
||
| 293 | * @return string |
||
| 294 | */ |
||
| 295 | public function __toString() |
||
| 299 | |||
| 300 | /** |
||
| 301 | * Get id |
||
| 302 | * |
||
| 303 | * @return integer |
||
| 304 | */ |
||
| 305 | public function getId() |
||
| 309 | |||
| 310 | /** |
||
| 311 | * @param int $id |
||
| 312 | */ |
||
| 313 | public function setId($id) |
||
| 317 | |||
| 318 | /** |
||
| 319 | * @return ArrayCollection |
||
| 320 | */ |
||
| 321 | public function getUsers() |
||
| 325 | |||
| 326 | /** |
||
| 327 | * @param $users |
||
| 328 | * @return $this |
||
| 329 | */ |
||
| 330 | public function setUsers($users) |
||
| 340 | |||
| 341 | /** |
||
| 342 | * @param SessionRelUser $user |
||
| 343 | */ |
||
| 344 | public function addUser(SessionRelUser $user) |
||
| 352 | |||
| 353 | /** |
||
| 354 | * @param int $status |
||
| 355 | * @param User $user |
||
| 356 | */ |
||
| 357 | public function addUserInSession($status, User $user) |
||
| 366 | |||
| 367 | /** |
||
| 368 | * @param SessionRelUser $subscription |
||
| 369 | * @return bool |
||
| 370 | */ |
||
| 371 | View Code Duplication | public function hasUser(SessionRelUser $subscription) |
|
| 389 | |||
| 390 | /** |
||
| 391 | * @return ArrayCollection |
||
| 392 | */ |
||
| 393 | public function getCourses() |
||
| 397 | |||
| 398 | /** |
||
| 399 | * @param $courses |
||
| 400 | */ |
||
| 401 | public function setCourses($courses) |
||
| 409 | |||
| 410 | /** |
||
| 411 | * @param SessionRelCourse $course |
||
| 412 | */ |
||
| 413 | public function addCourses(SessionRelCourse $course) |
||
| 418 | |||
| 419 | /** |
||
| 420 | * @param Course $course |
||
| 421 | * |
||
| 422 | * @return bool |
||
| 423 | */ |
||
| 424 | public function hasCourse(Course $course) |
||
| 437 | |||
| 438 | |||
| 439 | /** |
||
| 440 | * Remove $course |
||
| 441 | * |
||
| 442 | * @param SessionRelCourse $course |
||
| 443 | */ |
||
| 444 | public function removeCourses($course) |
||
| 452 | |||
| 453 | /** |
||
| 454 | * @param User $user |
||
| 455 | * @param Course $course |
||
| 456 | * @param int $status if not set it will check if the user is registered |
||
| 457 | * with any status |
||
| 458 | * |
||
| 459 | * @return bool |
||
| 460 | */ |
||
| 461 | public function hasUserInCourse(User $user, Course $course, $status = null) |
||
| 467 | |||
| 468 | /** |
||
| 469 | * @param User $user |
||
| 470 | * @param Course $course |
||
| 471 | * |
||
| 472 | * @return bool |
||
| 473 | */ |
||
| 474 | public function hasStudentInCourse(User $user, Course $course) |
||
| 478 | |||
| 479 | /** |
||
| 480 | * @param User $user |
||
| 481 | * @param Course $course |
||
| 482 | * |
||
| 483 | * @return bool |
||
| 484 | */ |
||
| 485 | public function hasCoachInCourseWithStatus(User $user, Course $course) |
||
| 489 | |||
| 490 | /** |
||
| 491 | * @param User $user |
||
| 492 | * @param Course $course |
||
| 493 | * @param string $status |
||
| 494 | * |
||
| 495 | * @return \Doctrine\Common\Collections\Collection|static |
||
| 496 | */ |
||
| 497 | public function getUserInCourse(User $user, Course $course, $status = null) |
||
| 513 | |||
| 514 | /** |
||
| 515 | * Set name |
||
| 516 | * |
||
| 517 | * @param string $name |
||
| 518 | * @return Session |
||
| 519 | */ |
||
| 520 | public function setName($name) |
||
| 526 | |||
| 527 | /** |
||
| 528 | * Get name |
||
| 529 | * |
||
| 530 | * @return string |
||
| 531 | */ |
||
| 532 | public function getName() |
||
| 536 | |||
| 537 | /** |
||
| 538 | * Set description |
||
| 539 | * |
||
| 540 | * @param string $description |
||
| 541 | * @return Session |
||
| 542 | */ |
||
| 543 | public function setDescription($description) |
||
| 549 | |||
| 550 | /** |
||
| 551 | * Get description |
||
| 552 | * |
||
| 553 | * @return string |
||
| 554 | */ |
||
| 555 | public function getDescription() |
||
| 559 | |||
| 560 | /** |
||
| 561 | * Set nbrCourses |
||
| 562 | * |
||
| 563 | * @param integer $nbrCourses |
||
| 564 | * @return Session |
||
| 565 | */ |
||
| 566 | public function setNbrCourses($nbrCourses) |
||
| 572 | |||
| 573 | /** |
||
| 574 | * Get nbrCourses |
||
| 575 | * |
||
| 576 | * @return integer |
||
| 577 | */ |
||
| 578 | public function getNbrCourses() |
||
| 582 | |||
| 583 | /** |
||
| 584 | * Set nbrUsers |
||
| 585 | * |
||
| 586 | * @param integer $nbrUsers |
||
| 587 | * @return Session |
||
| 588 | */ |
||
| 589 | public function setNbrUsers($nbrUsers) |
||
| 595 | |||
| 596 | /** |
||
| 597 | * Get nbrUsers |
||
| 598 | * |
||
| 599 | * @return integer |
||
| 600 | */ |
||
| 601 | public function getNbrUsers() |
||
| 605 | |||
| 606 | /** |
||
| 607 | * Set nbrClasses |
||
| 608 | * |
||
| 609 | * @param integer $nbrClasses |
||
| 610 | * @return Session |
||
| 611 | */ |
||
| 612 | public function setNbrClasses($nbrClasses) |
||
| 618 | |||
| 619 | /** |
||
| 620 | * Get nbrClasses |
||
| 621 | * |
||
| 622 | * @return integer |
||
| 623 | */ |
||
| 624 | public function getNbrClasses() |
||
| 628 | |||
| 629 | /** |
||
| 630 | * Set sessionAdminId |
||
| 631 | * |
||
| 632 | * @param integer $sessionAdminId |
||
| 633 | * @return Session |
||
| 634 | */ |
||
| 635 | public function setSessionAdminId($sessionAdminId) |
||
| 641 | |||
| 642 | /** |
||
| 643 | * Get sessionAdminId |
||
| 644 | * |
||
| 645 | * @return integer |
||
| 646 | */ |
||
| 647 | public function getSessionAdminId() |
||
| 651 | |||
| 652 | /** |
||
| 653 | * Set visibility |
||
| 654 | * |
||
| 655 | * @param integer $visibility |
||
| 656 | * @return Session |
||
| 657 | */ |
||
| 658 | public function setVisibility($visibility) |
||
| 664 | |||
| 665 | /** |
||
| 666 | * Get visibility |
||
| 667 | * |
||
| 668 | * @return integer |
||
| 669 | */ |
||
| 670 | public function getVisibility() |
||
| 674 | |||
| 675 | /** |
||
| 676 | * Set promotionId |
||
| 677 | * |
||
| 678 | * @param integer $promotionId |
||
| 679 | * @return Session |
||
| 680 | */ |
||
| 681 | public function setPromotionId($promotionId) |
||
| 687 | |||
| 688 | /** |
||
| 689 | * Get promotionId |
||
| 690 | * |
||
| 691 | * @return integer |
||
| 692 | */ |
||
| 693 | public function getPromotionId() |
||
| 697 | |||
| 698 | /** |
||
| 699 | * Set displayStartDate |
||
| 700 | * |
||
| 701 | * @param \DateTime $displayStartDate |
||
| 702 | * @return Session |
||
| 703 | */ |
||
| 704 | public function setDisplayStartDate($displayStartDate) |
||
| 710 | |||
| 711 | /** |
||
| 712 | * Get displayStartDate |
||
| 713 | * |
||
| 714 | * @return \DateTime |
||
| 715 | */ |
||
| 716 | public function getDisplayStartDate() |
||
| 720 | |||
| 721 | /** |
||
| 722 | * Set displayEndDate |
||
| 723 | * |
||
| 724 | * @param \DateTime $displayEndDate |
||
| 725 | * @return Session |
||
| 726 | */ |
||
| 727 | public function setDisplayEndDate($displayEndDate) |
||
| 733 | |||
| 734 | /** |
||
| 735 | * Get displayEndDate |
||
| 736 | * |
||
| 737 | * @return \DateTime |
||
| 738 | */ |
||
| 739 | public function getDisplayEndDate() |
||
| 743 | |||
| 744 | /** |
||
| 745 | * Set accessStartDate |
||
| 746 | * |
||
| 747 | * @param \DateTime $accessStartDate |
||
| 748 | * @return Session |
||
| 749 | */ |
||
| 750 | public function setAccessStartDate($accessStartDate) |
||
| 756 | |||
| 757 | /** |
||
| 758 | * Get accessStartDate |
||
| 759 | * |
||
| 760 | * @return \DateTime |
||
| 761 | */ |
||
| 762 | public function getAccessStartDate() |
||
| 766 | |||
| 767 | /** |
||
| 768 | * Set accessEndDate |
||
| 769 | * |
||
| 770 | * @param \DateTime $accessEndDate |
||
| 771 | * @return Session |
||
| 772 | */ |
||
| 773 | public function setAccessEndDate($accessEndDate) |
||
| 779 | |||
| 780 | /** |
||
| 781 | * Get accessEndDate |
||
| 782 | * |
||
| 783 | * @return \DateTime |
||
| 784 | */ |
||
| 785 | public function getAccessEndDate() |
||
| 789 | |||
| 790 | /** |
||
| 791 | * Set coachAccessStartDate |
||
| 792 | * |
||
| 793 | * @param \DateTime $coachAccessStartDate |
||
| 794 | * @return Session |
||
| 795 | */ |
||
| 796 | public function setCoachAccessStartDate($coachAccessStartDate) |
||
| 802 | |||
| 803 | /** |
||
| 804 | * Get coachAccessStartDate |
||
| 805 | * |
||
| 806 | * @return \DateTime |
||
| 807 | */ |
||
| 808 | public function getCoachAccessStartDate() |
||
| 812 | |||
| 813 | /** |
||
| 814 | * Set coachAccessEndDate |
||
| 815 | * |
||
| 816 | * @param \DateTime $coachAccessEndDate |
||
| 817 | * @return Session |
||
| 818 | */ |
||
| 819 | public function setCoachAccessEndDate($coachAccessEndDate) |
||
| 825 | |||
| 826 | /** |
||
| 827 | * Get coachAccessEndDate |
||
| 828 | * |
||
| 829 | * @return \DateTime |
||
| 830 | */ |
||
| 831 | public function getCoachAccessEndDate() |
||
| 835 | |||
| 836 | /** |
||
| 837 | * Get id |
||
| 838 | * |
||
| 839 | * @return User |
||
| 840 | */ |
||
| 841 | public function getGeneralCoach() |
||
| 845 | |||
| 846 | /** |
||
| 847 | * @param $coach |
||
| 848 | * @return $this |
||
| 849 | */ |
||
| 850 | public function setGeneralCoach($coach) |
||
| 856 | |||
| 857 | /** |
||
| 858 | * @return mixed |
||
| 859 | * @return SessionCategory |
||
| 860 | */ |
||
| 861 | public function getCategory() |
||
| 865 | |||
| 866 | /** |
||
| 867 | * @param $category |
||
| 868 | * @return $this |
||
| 869 | */ |
||
| 870 | public function setCategory($category) |
||
| 876 | |||
| 877 | /** |
||
| 878 | * @return array |
||
| 879 | */ |
||
| 880 | public static function getStatusList() |
||
| 889 | |||
| 890 | /** |
||
| 891 | * Check if session is visible |
||
| 892 | * @return bool |
||
| 893 | */ |
||
| 894 | public function isActive() |
||
| 905 | |||
| 906 | /** |
||
| 907 | * @return bool |
||
| 908 | */ |
||
| 909 | public function isActiveForStudent() |
||
| 916 | |||
| 917 | /** |
||
| 918 | * @return bool |
||
| 919 | */ |
||
| 920 | public function isActiveForCoach() |
||
| 927 | |||
| 928 | /** |
||
| 929 | * @param $start |
||
| 930 | * @param $end |
||
| 931 | * @return bool |
||
| 932 | */ |
||
| 933 | private function compareDates($start, $end) |
||
| 957 | |||
| 958 | /** |
||
| 959 | * @param Course $course |
||
| 960 | */ |
||
| 961 | public function addCourse(Course $course) |
||
| 967 | |||
| 968 | /** |
||
| 969 | * @return ArrayCollection |
||
| 970 | */ |
||
| 971 | public function getUserCourseSubscriptions() |
||
| 975 | |||
| 976 | /** |
||
| 977 | * @param ArrayCollection $userCourseSubscriptions |
||
| 978 | */ |
||
| 979 | public function setUserCourseSubscriptions($userCourseSubscriptions) |
||
| 987 | |||
| 988 | /** |
||
| 989 | * @param SessionRelCourseRelUser $subscription |
||
| 990 | */ |
||
| 991 | public function addUserCourseSubscription(SessionRelCourseRelUser $subscription) |
||
| 998 | |||
| 999 | /** |
||
| 1000 | * @param int $status |
||
| 1001 | * @param User $user |
||
| 1002 | * @param Course $course |
||
| 1003 | */ |
||
| 1004 | public function addUserInCourse($status, User $user, Course $course) |
||
| 1013 | |||
| 1014 | /** |
||
| 1015 | * @param SessionRelCourseRelUser $subscription |
||
| 1016 | * @return bool |
||
| 1017 | */ |
||
| 1018 | View Code Duplication | public function hasUserCourseSubscription(SessionRelCourseRelUser $subscription) |
|
| 1035 | |||
| 1036 | /** |
||
| 1037 | * currentCourse is set in CourseListener |
||
| 1038 | * @return Course |
||
| 1039 | */ |
||
| 1040 | public function getCurrentCourse() |
||
| 1044 | |||
| 1045 | /** |
||
| 1046 | * currentCourse is set in CourseListener |
||
| 1047 | * @param Course $course |
||
| 1048 | * @return $this |
||
| 1049 | */ |
||
| 1050 | public function setCurrentCourse(Course $course) |
||
| 1066 | |||
| 1067 | /** |
||
| 1068 | * Set $sendSubscriptionNotification |
||
| 1069 | * @param boolean $sendNotification |
||
| 1070 | * @return \Chamilo\CoreBundle\Entity\Session |
||
| 1071 | */ |
||
| 1072 | public function setSendSubscriptionNotification($sendNotification) |
||
| 1078 | |||
| 1079 | /** |
||
| 1080 | * Get $sendSubscriptionNotification |
||
| 1081 | * @return boolean |
||
| 1082 | */ |
||
| 1083 | public function getSendSubscriptionNotification() |
||
| 1087 | |||
| 1088 | /** |
||
| 1089 | * Get user from course by status |
||
| 1090 | * @param \Chamilo\CoreBundle\Entity\Course $course |
||
| 1091 | * @param string $status |
||
| 1092 | * @return \Doctrine\Common\Collections\Collection|static |
||
| 1093 | */ |
||
| 1094 | public function getUserCourseSubscriptionsByStatus(Course $course, $status) |
||
| 1106 | |||
| 1107 | public function getBuyCoursePluginPrice() |
||
| 1126 | |||
| 1127 | /** |
||
| 1128 | * @param ArrayCollection $studentPublications |
||
| 1129 | * @return Session |
||
| 1130 | */ |
||
| 1131 | public function setStudentPublications(ArrayCollection $studentPublications) |
||
| 1141 | |||
| 1142 | /** |
||
| 1143 | * @param CStudentPublication $studentPublication |
||
| 1144 | * @return Session |
||
| 1145 | */ |
||
| 1146 | public function addStudentPublication(CStudentPublication $studentPublication) |
||
| 1152 | |||
| 1153 | /** |
||
| 1154 | * Get studentPublications |
||
| 1155 | * @return ArrayCollection |
||
| 1156 | */ |
||
| 1157 | public function getStudentPublications() |
||
| 1161 | |||
| 1162 | /** |
||
| 1163 | * Get issuedSkills |
||
| 1164 | * @return ArrayCollection |
||
| 1165 | */ |
||
| 1166 | public function getIssuedSkills() |
||
| 1170 | |||
| 1171 | /** |
||
| 1172 | * @param AccessUrl $url |
||
| 1173 | * |
||
| 1174 | * @return $this |
||
| 1175 | */ |
||
| 1176 | View Code Duplication | public function setCurrentUrl(AccessUrl $url) |
|
| 1189 | |||
| 1190 | /** |
||
| 1191 | * @return AccessUrl |
||
| 1192 | */ |
||
| 1193 | public function getCurrentUrl() |
||
| 1197 | |||
| 1198 | /** |
||
| 1199 | * @return ArrayCollection |
||
| 1200 | */ |
||
| 1201 | public function getUrls() |
||
| 1205 | |||
| 1206 | /** |
||
| 1207 | * @param $urls |
||
| 1208 | */ |
||
| 1209 | public function setUrls($urls) |
||
| 1217 | |||
| 1218 | /** |
||
| 1219 | * @param AccessUrlRelSession $url |
||
| 1220 | */ |
||
| 1221 | public function addUrls(AccessUrlRelSession $url) |
||
| 1226 | } |
||
| 1227 |
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.