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 User 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 User, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 53 | class User implements UserInterface //implements ParticipantInterface, ThemeUser |
||
| 54 | { |
||
| 55 | const COURSE_MANAGER = 1; |
||
| 56 | const TEACHER = 1; |
||
| 57 | const SESSION_ADMIN = 3; |
||
| 58 | const DRH = 4; |
||
| 59 | const STUDENT = 5; |
||
| 60 | const ANONYMOUS = 6; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @var integer |
||
| 64 | * |
||
| 65 | * @ORM\Column(name="id", type="integer") |
||
| 66 | * @ORM\Id |
||
| 67 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 68 | */ |
||
| 69 | protected $id; |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @var integer |
||
| 73 | * |
||
| 74 | * @ORM\Column(name="user_id", type="integer", nullable=true) |
||
| 75 | */ |
||
| 76 | protected $userId; |
||
| 77 | |||
| 78 | /** |
||
| 79 | * @var string |
||
| 80 | * |
||
| 81 | * @ORM\Column(name="username", type="string", length=100, nullable=false, unique=true) |
||
| 82 | */ |
||
| 83 | protected $username; |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @var string |
||
| 87 | * |
||
| 88 | * @ORM\Column(name="username_canonical", type="string", length=100, nullable=false, unique=true) |
||
| 89 | */ |
||
| 90 | protected $usernameCanonical; |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @var string |
||
| 94 | * @ORM\Column(name="email_canonical", type="string", length=100, nullable=false, unique=true) |
||
| 95 | */ |
||
| 96 | protected $emailCanonical; |
||
| 97 | |||
| 98 | /** |
||
| 99 | * @var string |
||
| 100 | * |
||
| 101 | * @ORM\Column(name="email", type="string", length=100, nullable=false, unique=false) |
||
| 102 | */ |
||
| 103 | protected $email; |
||
| 104 | |||
| 105 | /** |
||
| 106 | * @var boolean |
||
| 107 | * @ORM\Column(name="locked", type="boolean") |
||
| 108 | */ |
||
| 109 | protected $locked; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * @var boolean |
||
| 113 | * @ORM\Column(name="enabled", type="boolean") |
||
| 114 | */ |
||
| 115 | protected $enabled; |
||
| 116 | |||
| 117 | /** |
||
| 118 | * @var boolean |
||
| 119 | * @ORM\Column(name="expired", type="boolean") |
||
| 120 | */ |
||
| 121 | protected $expired; |
||
| 122 | |||
| 123 | /** |
||
| 124 | * @var boolean |
||
| 125 | * @ORM\Column(name="credentials_expired", type="boolean") |
||
| 126 | */ |
||
| 127 | protected $credentialsExpired; |
||
| 128 | |||
| 129 | /** |
||
| 130 | * @var \DateTime |
||
| 131 | * @ORM\Column(name="credentials_expire_at", type="datetime", nullable=true, unique=false) |
||
| 132 | */ |
||
| 133 | protected $credentialsExpireAt; |
||
| 134 | |||
| 135 | /** |
||
| 136 | * @var \DateTime |
||
| 137 | * @ORM\Column(name="expires_at", type="datetime", nullable=true, unique=false) |
||
| 138 | */ |
||
| 139 | protected $expiresAt; |
||
| 140 | |||
| 141 | /** |
||
| 142 | * @var string |
||
| 143 | * |
||
| 144 | * @ORM\Column(name="lastname", type="string", length=60, nullable=true, unique=false) |
||
| 145 | */ |
||
| 146 | protected $lastname; |
||
| 147 | |||
| 148 | /** |
||
| 149 | * @var string |
||
| 150 | * |
||
| 151 | * @ORM\Column(name="firstname", type="string", length=60, nullable=true, unique=false) |
||
| 152 | */ |
||
| 153 | protected $firstname; |
||
| 154 | |||
| 155 | /** |
||
| 156 | * @var string |
||
| 157 | * |
||
| 158 | * @ORM\Column(name="password", type="string", length=255, nullable=false, unique=false) |
||
| 159 | */ |
||
| 160 | protected $password; |
||
| 161 | |||
| 162 | /** |
||
| 163 | * @var string |
||
| 164 | * |
||
| 165 | * @ORM\Column(name="auth_source", type="string", length=50, nullable=true, unique=false) |
||
| 166 | */ |
||
| 167 | private $authSource; |
||
| 168 | |||
| 169 | /** |
||
| 170 | * @var boolean |
||
| 171 | * |
||
| 172 | * @ORM\Column(name="status", type="integer", nullable=false) |
||
| 173 | */ |
||
| 174 | private $status; |
||
| 175 | |||
| 176 | /** |
||
| 177 | * @var string |
||
| 178 | * |
||
| 179 | * @ORM\Column(name="official_code", type="string", length=40, nullable=true, unique=false) |
||
| 180 | */ |
||
| 181 | private $officialCode; |
||
| 182 | |||
| 183 | /** |
||
| 184 | * @var string |
||
| 185 | * |
||
| 186 | * @ORM\Column(name="phone", type="string", length=30, nullable=true, unique=false) |
||
| 187 | */ |
||
| 188 | protected $phone; |
||
| 189 | |||
| 190 | /** |
||
| 191 | * Vich\UploadableField(mapping="user_image", fileNameProperty="picture_uri") |
||
| 192 | * |
||
| 193 | * note This is not a mapped field of entity metadata, just a simple property. |
||
| 194 | * |
||
| 195 | * @var File $imageFile |
||
| 196 | */ |
||
| 197 | protected $imageFile; |
||
| 198 | |||
| 199 | /** |
||
| 200 | * @var string |
||
| 201 | * @ORM\Column(name="picture_uri", type="string", length=250, nullable=true, unique=false) |
||
| 202 | */ |
||
| 203 | private $pictureUri; |
||
| 204 | |||
| 205 | /** |
||
| 206 | * ORM\ManyToOne(targetEntity="Application\Sonata\MediaBundle\Entity\Media", cascade={"all"} ) |
||
| 207 | * @ORM\JoinColumn(name="picture_uri", referencedColumnName="id") |
||
| 208 | */ |
||
| 209 | //protected $pictureUri; |
||
| 210 | |||
| 211 | /** |
||
| 212 | * @var integer |
||
| 213 | * |
||
| 214 | * @ORM\Column(name="creator_id", type="integer", nullable=true, unique=false) |
||
| 215 | */ |
||
| 216 | private $creatorId; |
||
| 217 | |||
| 218 | /** |
||
| 219 | * @var string |
||
| 220 | * |
||
| 221 | * @ORM\Column(name="competences", type="text", nullable=true, unique=false) |
||
| 222 | */ |
||
| 223 | private $competences; |
||
| 224 | |||
| 225 | /** |
||
| 226 | * @var string |
||
| 227 | * |
||
| 228 | * @ORM\Column(name="diplomas", type="text", nullable=true, unique=false) |
||
| 229 | */ |
||
| 230 | private $diplomas; |
||
| 231 | |||
| 232 | /** |
||
| 233 | * @var string |
||
| 234 | * |
||
| 235 | * @ORM\Column(name="openarea", type="text", nullable=true, unique=false) |
||
| 236 | */ |
||
| 237 | private $openarea; |
||
| 238 | |||
| 239 | /** |
||
| 240 | * @var string |
||
| 241 | * |
||
| 242 | * @ORM\Column(name="teach", type="text", nullable=true, unique=false) |
||
| 243 | */ |
||
| 244 | private $teach; |
||
| 245 | |||
| 246 | /** |
||
| 247 | * @var string |
||
| 248 | * |
||
| 249 | * @ORM\Column(name="productions", type="string", length=250, nullable=true, unique=false) |
||
| 250 | */ |
||
| 251 | private $productions; |
||
| 252 | |||
| 253 | /** |
||
| 254 | * @var integer |
||
| 255 | * |
||
| 256 | * @ORM\Column(name="chatcall_user_id", type="integer", nullable=true, unique=false) |
||
| 257 | */ |
||
| 258 | private $chatcallUserId; |
||
| 259 | |||
| 260 | /** |
||
| 261 | * @var \DateTime |
||
| 262 | * |
||
| 263 | * @ORM\Column(name="chatcall_date", type="datetime", nullable=true, unique=false) |
||
| 264 | */ |
||
| 265 | private $chatcallDate; |
||
| 266 | |||
| 267 | /** |
||
| 268 | * @var string |
||
| 269 | * |
||
| 270 | * @ORM\Column(name="chatcall_text", type="string", length=50, nullable=true, unique=false) |
||
| 271 | */ |
||
| 272 | private $chatcallText; |
||
| 273 | |||
| 274 | /** |
||
| 275 | * @var string |
||
| 276 | * |
||
| 277 | * @ORM\Column(name="language", type="string", length=40, nullable=true, unique=false) |
||
| 278 | */ |
||
| 279 | private $language; |
||
| 280 | |||
| 281 | /** |
||
| 282 | * @var \DateTime |
||
| 283 | * |
||
| 284 | * @ORM\Column(name="registration_date", type="datetime", nullable=false, unique=false) |
||
| 285 | */ |
||
| 286 | private $registrationDate; |
||
| 287 | |||
| 288 | /** |
||
| 289 | * @var \DateTime |
||
| 290 | * |
||
| 291 | * @ORM\Column(name="expiration_date", type="datetime", nullable=true, unique=false) |
||
| 292 | */ |
||
| 293 | private $expirationDate; |
||
| 294 | |||
| 295 | /** |
||
| 296 | * @var boolean |
||
| 297 | * |
||
| 298 | * @ORM\Column(name="active", type="boolean", nullable=false, unique=false) |
||
| 299 | */ |
||
| 300 | private $active; |
||
| 301 | |||
| 302 | /** |
||
| 303 | * @var string |
||
| 304 | * |
||
| 305 | * @ORM\Column(name="openid", type="string", length=255, nullable=true, unique=false) |
||
| 306 | */ |
||
| 307 | private $openid; |
||
| 308 | |||
| 309 | /** |
||
| 310 | * @var string |
||
| 311 | * |
||
| 312 | * @ORM\Column(name="theme", type="string", length=255, nullable=true, unique=false) |
||
| 313 | */ |
||
| 314 | private $theme; |
||
| 315 | |||
| 316 | /** |
||
| 317 | * @var integer |
||
| 318 | * |
||
| 319 | * @ORM\Column(name="hr_dept_id", type="smallint", nullable=true, unique=false) |
||
| 320 | */ |
||
| 321 | private $hrDeptId; |
||
| 322 | |||
| 323 | /** |
||
| 324 | * @ORM\Column(type="string", length=255) |
||
| 325 | */ |
||
| 326 | protected $salt; |
||
| 327 | |||
| 328 | /** |
||
| 329 | * @var \DateTime |
||
| 330 | * |
||
| 331 | * @ORM\Column(name="last_login", type="datetime", nullable=true, unique=false) |
||
| 332 | */ |
||
| 333 | protected $lastLogin; |
||
| 334 | |||
| 335 | /** |
||
| 336 | * @var \DateTime |
||
| 337 | * @ORM\Column(name="created_at", type="datetime", nullable=true, unique=false) |
||
| 338 | */ |
||
| 339 | protected $createdAt; |
||
| 340 | |||
| 341 | /** |
||
| 342 | * @var \DateTime |
||
| 343 | * @ORM\Column(name="updated_at", type="datetime", nullable=true, unique=false) |
||
| 344 | */ |
||
| 345 | protected $updatedAt; |
||
| 346 | |||
| 347 | /** |
||
| 348 | * Random string sent to the user email address in order to verify it |
||
| 349 | * |
||
| 350 | * @var string |
||
| 351 | * @ORM\Column(name="confirmation_token", type="string", length=255, nullable=true) |
||
| 352 | */ |
||
| 353 | protected $confirmationToken; |
||
| 354 | |||
| 355 | /** |
||
| 356 | * @var \DateTime |
||
| 357 | * |
||
| 358 | * @ORM\Column(name="password_requested_at", type="datetime", nullable=true, unique=false) |
||
| 359 | */ |
||
| 360 | protected $passwordRequestedAt; |
||
| 361 | |||
| 362 | |||
| 363 | |||
| 364 | /** |
||
| 365 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\CourseRelUser", mappedBy="user") |
||
| 366 | **/ |
||
| 367 | protected $courses; |
||
| 368 | |||
| 369 | /** |
||
| 370 | * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CItemProperty", mappedBy="user") |
||
| 371 | **/ |
||
| 372 | //protected $items; |
||
| 373 | |||
| 374 | /** |
||
| 375 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\UsergroupRelUser", mappedBy="user") |
||
| 376 | **/ |
||
| 377 | protected $classes; |
||
| 378 | |||
| 379 | /** |
||
| 380 | * ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CDropboxPost", mappedBy="user") |
||
| 381 | **/ |
||
| 382 | protected $dropBoxReceivedFiles; |
||
| 383 | |||
| 384 | /** |
||
| 385 | * ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CDropboxFile", mappedBy="userSent") |
||
| 386 | **/ |
||
| 387 | protected $dropBoxSentFiles; |
||
| 388 | |||
| 389 | /** |
||
| 390 | * @ORM\Column(type="array") |
||
| 391 | */ |
||
| 392 | protected $roles; |
||
| 393 | |||
| 394 | /** |
||
| 395 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\JuryMembers", mappedBy="user") |
||
| 396 | **/ |
||
| 397 | //protected $jurySubscriptions; |
||
| 398 | |||
| 399 | /** |
||
| 400 | * @ORM\ManyToMany(targetEntity="Chamilo\UserBundle\Entity\Group") |
||
| 401 | * @ORM\JoinTable(name="fos_user_user_group", |
||
| 402 | * joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")}, |
||
| 403 | * inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")} |
||
| 404 | * ) |
||
| 405 | */ |
||
| 406 | protected $groups; |
||
| 407 | |||
| 408 | |||
| 409 | //private $isActive; |
||
| 410 | |||
| 411 | /** |
||
| 412 | * ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\CurriculumItemRelUser", mappedBy="user") |
||
| 413 | **/ |
||
| 414 | protected $curriculumItems; |
||
| 415 | |||
| 416 | /* |
||
| 417 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\AccessUrlRelUser", mappedBy="user") |
||
| 418 | * |
||
| 419 | */ |
||
| 420 | protected $portals; |
||
| 421 | |||
| 422 | /** |
||
| 423 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Session", mappedBy="generalCoach") |
||
| 424 | **/ |
||
| 425 | protected $sessionAsGeneralCoach; |
||
| 426 | |||
| 427 | /** |
||
| 428 | * @var ArrayCollection |
||
| 429 | * ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\UserFieldValues", mappedBy="user", orphanRemoval=true, cascade={"persist"}) |
||
| 430 | **/ |
||
| 431 | protected $extraFields; |
||
| 432 | |||
| 433 | /** |
||
| 434 | * ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="creator") |
||
| 435 | **/ |
||
| 436 | protected $resourceNodes; |
||
| 437 | |||
| 438 | /** |
||
| 439 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SessionRelCourseRelUser", mappedBy="user", cascade={"persist"}) |
||
| 440 | **/ |
||
| 441 | protected $sessionCourseSubscriptions; |
||
| 442 | |||
| 443 | /** |
||
| 444 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SkillRelUser", mappedBy="user", cascade={"persist"}) |
||
| 445 | */ |
||
| 446 | protected $achievedSkills; |
||
| 447 | |||
| 448 | /** |
||
| 449 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SkillRelUserComment", mappedBy="feedbackGiver") |
||
| 450 | */ |
||
| 451 | protected $commentedUserSkills; |
||
| 452 | |||
| 453 | /** |
||
| 454 | * Constructor |
||
| 455 | */ |
||
| 456 | public function __construct() |
||
| 484 | |||
| 485 | /** |
||
| 486 | * @return string |
||
| 487 | */ |
||
| 488 | public function __toString() |
||
| 492 | |||
| 493 | /** |
||
| 494 | * Updates the id with the user_id |
||
| 495 | * @ORM\PostPersist() |
||
| 496 | */ |
||
| 497 | public function postPersist(LifecycleEventArgs $args) |
||
| 507 | |||
| 508 | /** |
||
| 509 | * @param int $userId |
||
| 510 | */ |
||
| 511 | public function setId($userId) |
||
| 515 | |||
| 516 | /** |
||
| 517 | * @param int $userId |
||
| 518 | */ |
||
| 519 | public function setUserId($userId) |
||
| 525 | |||
| 526 | /** |
||
| 527 | * @return int |
||
| 528 | */ |
||
| 529 | public function getId() |
||
| 533 | |||
| 534 | /** |
||
| 535 | * @return string |
||
| 536 | */ |
||
| 537 | public function getEncoderName() |
||
| 541 | |||
| 542 | /** |
||
| 543 | * @return ArrayCollection |
||
| 544 | */ |
||
| 545 | public function getDropBoxSentFiles() |
||
| 549 | |||
| 550 | /** |
||
| 551 | * @return ArrayCollection |
||
| 552 | */ |
||
| 553 | public function getDropBoxReceivedFiles() |
||
| 557 | |||
| 558 | /** |
||
| 559 | * @return ArrayCollection |
||
| 560 | */ |
||
| 561 | public function getCourses() |
||
| 565 | |||
| 566 | /** |
||
| 567 | * @return array |
||
| 568 | */ |
||
| 569 | View Code Duplication | public static function getPasswordConstraints() |
|
| 592 | |||
| 593 | /** |
||
| 594 | * @param ClassMetadata $metadata |
||
| 595 | */ |
||
| 596 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
||
| 621 | |||
| 622 | /** |
||
| 623 | * @inheritDoc |
||
| 624 | */ |
||
| 625 | public function isEqualTo(UserInterface $user) |
||
| 645 | |||
| 646 | /** |
||
| 647 | * @return ArrayCollection |
||
| 648 | */ |
||
| 649 | public function getPortals() |
||
| 653 | |||
| 654 | /** |
||
| 655 | * @param $portal |
||
| 656 | */ |
||
| 657 | public function setPortal($portal) |
||
| 661 | |||
| 662 | /** |
||
| 663 | * @return ArrayCollection |
||
| 664 | */ |
||
| 665 | public function getCurriculumItems() |
||
| 669 | |||
| 670 | /** |
||
| 671 | * @param $items |
||
| 672 | */ |
||
| 673 | public function setCurriculumItems($items) |
||
| 677 | |||
| 678 | /** |
||
| 679 | * @return bool |
||
| 680 | */ |
||
| 681 | public function getIsActive() |
||
| 685 | |||
| 686 | /** |
||
| 687 | * @return bool |
||
| 688 | */ |
||
| 689 | public function isActive() |
||
| 693 | |||
| 694 | |||
| 695 | /** |
||
| 696 | * @inheritDoc |
||
| 697 | */ |
||
| 698 | public function isEnabled() |
||
| 702 | |||
| 703 | /** |
||
| 704 | * |
||
| 705 | * @return ArrayCollection |
||
| 706 | */ |
||
| 707 | /*public function getRolesObj() |
||
| 708 | { |
||
| 709 | return $this->roles; |
||
| 710 | }*/ |
||
| 711 | |||
| 712 | /** |
||
| 713 | * Set salt |
||
| 714 | * |
||
| 715 | * @param string $salt |
||
| 716 | * |
||
| 717 | * @return User |
||
| 718 | */ |
||
| 719 | public function setSalt($salt) |
||
| 725 | |||
| 726 | /** |
||
| 727 | * Get salt |
||
| 728 | * |
||
| 729 | * @return string |
||
| 730 | */ |
||
| 731 | public function getSalt() |
||
| 735 | |||
| 736 | /** |
||
| 737 | * @return ArrayCollection |
||
| 738 | */ |
||
| 739 | public function getClasses() |
||
| 743 | |||
| 744 | /** |
||
| 745 | * |
||
| 746 | */ |
||
| 747 | public function getLps() |
||
| 762 | |||
| 763 | /** |
||
| 764 | * Return Complete Name with the Username |
||
| 765 | * |
||
| 766 | * @return string |
||
| 767 | */ |
||
| 768 | public function getCompleteNameWithUsername() |
||
| 772 | |||
| 773 | /** |
||
| 774 | * @todo don't use api_get_person_name |
||
| 775 | * @return string |
||
| 776 | */ |
||
| 777 | public function getCompleteName() |
||
| 781 | |||
| 782 | /** |
||
| 783 | * Returns the list of classes for the user |
||
| 784 | * @return string |
||
| 785 | */ |
||
| 786 | View Code Duplication | public function getCompleteNameWithClasses() |
|
| 799 | |||
| 800 | /** |
||
| 801 | * Get userId |
||
| 802 | * |
||
| 803 | * @return integer |
||
| 804 | */ |
||
| 805 | public function getUserId() |
||
| 809 | |||
| 810 | /** |
||
| 811 | * Set lastname |
||
| 812 | * |
||
| 813 | * @param string $lastname |
||
| 814 | * |
||
| 815 | * @return User |
||
| 816 | */ |
||
| 817 | public function setLastname($lastname) |
||
| 823 | |||
| 824 | |||
| 825 | /** |
||
| 826 | * Set firstname |
||
| 827 | * |
||
| 828 | * @param string $firstname |
||
| 829 | * |
||
| 830 | * @return User |
||
| 831 | */ |
||
| 832 | public function setFirstname($firstname) |
||
| 838 | |||
| 839 | /** |
||
| 840 | * Set password |
||
| 841 | * |
||
| 842 | * @param string $password |
||
| 843 | * @return User |
||
| 844 | */ |
||
| 845 | public function setPassword($password) |
||
| 851 | |||
| 852 | /** |
||
| 853 | * Get password |
||
| 854 | * |
||
| 855 | * @return string |
||
| 856 | */ |
||
| 857 | public function getPassword() |
||
| 861 | |||
| 862 | /** |
||
| 863 | * Set authSource |
||
| 864 | * |
||
| 865 | * @param string $authSource |
||
| 866 | * @return User |
||
| 867 | */ |
||
| 868 | public function setAuthSource($authSource) |
||
| 874 | |||
| 875 | /** |
||
| 876 | * Get authSource |
||
| 877 | * |
||
| 878 | * @return string |
||
| 879 | */ |
||
| 880 | public function getAuthSource() |
||
| 884 | |||
| 885 | /** |
||
| 886 | * Set email |
||
| 887 | * |
||
| 888 | * @param string $email |
||
| 889 | * @return User |
||
| 890 | */ |
||
| 891 | public function setEmail($email) |
||
| 897 | |||
| 898 | /** |
||
| 899 | * Get email |
||
| 900 | * |
||
| 901 | * @return string |
||
| 902 | */ |
||
| 903 | public function getEmail() |
||
| 907 | |||
| 908 | /** |
||
| 909 | * Set status |
||
| 910 | * |
||
| 911 | * @param int $status |
||
| 912 | * |
||
| 913 | * @return User |
||
| 914 | */ |
||
| 915 | public function setStatus($status) |
||
| 921 | |||
| 922 | /** |
||
| 923 | * Get status |
||
| 924 | * |
||
| 925 | * @return boolean |
||
| 926 | */ |
||
| 927 | public function getStatus() |
||
| 931 | |||
| 932 | /** |
||
| 933 | * Set officialCode |
||
| 934 | * |
||
| 935 | * @param string $officialCode |
||
| 936 | * @return User |
||
| 937 | */ |
||
| 938 | public function setOfficialCode($officialCode) |
||
| 944 | |||
| 945 | /** |
||
| 946 | * Get officialCode |
||
| 947 | * |
||
| 948 | * @return string |
||
| 949 | */ |
||
| 950 | public function getOfficialCode() |
||
| 954 | |||
| 955 | /** |
||
| 956 | * Set phone |
||
| 957 | * |
||
| 958 | * @param string $phone |
||
| 959 | * @return User |
||
| 960 | */ |
||
| 961 | public function setPhone($phone) |
||
| 967 | |||
| 968 | /** |
||
| 969 | * Get phone |
||
| 970 | * |
||
| 971 | * @return string |
||
| 972 | */ |
||
| 973 | public function getPhone() |
||
| 977 | |||
| 978 | /** |
||
| 979 | * Set pictureUri |
||
| 980 | * |
||
| 981 | * @param string $pictureUri |
||
| 982 | * @return User |
||
| 983 | */ |
||
| 984 | public function setPictureUri($pictureUri) |
||
| 990 | |||
| 991 | /** |
||
| 992 | * Get pictureUri |
||
| 993 | * |
||
| 994 | * @return Media |
||
| 995 | */ |
||
| 996 | public function getPictureUri() |
||
| 1000 | |||
| 1001 | /** |
||
| 1002 | * Set creatorId |
||
| 1003 | * |
||
| 1004 | * @param integer $creatorId |
||
| 1005 | * @return User |
||
| 1006 | */ |
||
| 1007 | public function setCreatorId($creatorId) |
||
| 1013 | |||
| 1014 | /** |
||
| 1015 | * Get creatorId |
||
| 1016 | * |
||
| 1017 | * @return integer |
||
| 1018 | */ |
||
| 1019 | public function getCreatorId() |
||
| 1023 | |||
| 1024 | /** |
||
| 1025 | * Set competences |
||
| 1026 | * |
||
| 1027 | * @param string $competences |
||
| 1028 | * @return User |
||
| 1029 | */ |
||
| 1030 | public function setCompetences($competences) |
||
| 1036 | |||
| 1037 | /** |
||
| 1038 | * Get competences |
||
| 1039 | * |
||
| 1040 | * @return string |
||
| 1041 | */ |
||
| 1042 | public function getCompetences() |
||
| 1046 | |||
| 1047 | /** |
||
| 1048 | * Set diplomas |
||
| 1049 | * |
||
| 1050 | * @param string $diplomas |
||
| 1051 | * @return User |
||
| 1052 | */ |
||
| 1053 | public function setDiplomas($diplomas) |
||
| 1059 | |||
| 1060 | /** |
||
| 1061 | * Get diplomas |
||
| 1062 | * |
||
| 1063 | * @return string |
||
| 1064 | */ |
||
| 1065 | public function getDiplomas() |
||
| 1069 | |||
| 1070 | /** |
||
| 1071 | * Set openarea |
||
| 1072 | * |
||
| 1073 | * @param string $openarea |
||
| 1074 | * @return User |
||
| 1075 | */ |
||
| 1076 | public function setOpenarea($openarea) |
||
| 1082 | |||
| 1083 | /** |
||
| 1084 | * Get openarea |
||
| 1085 | * |
||
| 1086 | * @return string |
||
| 1087 | */ |
||
| 1088 | public function getOpenarea() |
||
| 1092 | |||
| 1093 | /** |
||
| 1094 | * Set teach |
||
| 1095 | * |
||
| 1096 | * @param string $teach |
||
| 1097 | * @return User |
||
| 1098 | */ |
||
| 1099 | public function setTeach($teach) |
||
| 1105 | |||
| 1106 | /** |
||
| 1107 | * Get teach |
||
| 1108 | * |
||
| 1109 | * @return string |
||
| 1110 | */ |
||
| 1111 | public function getTeach() |
||
| 1115 | |||
| 1116 | /** |
||
| 1117 | * Set productions |
||
| 1118 | * |
||
| 1119 | * @param string $productions |
||
| 1120 | * @return User |
||
| 1121 | */ |
||
| 1122 | public function setProductions($productions) |
||
| 1128 | |||
| 1129 | /** |
||
| 1130 | * Get productions |
||
| 1131 | * |
||
| 1132 | * @return string |
||
| 1133 | */ |
||
| 1134 | public function getProductions() |
||
| 1138 | |||
| 1139 | /** |
||
| 1140 | * Set chatcallUserId |
||
| 1141 | * |
||
| 1142 | * @param integer $chatcallUserId |
||
| 1143 | * @return User |
||
| 1144 | */ |
||
| 1145 | public function setChatcallUserId($chatcallUserId) |
||
| 1151 | |||
| 1152 | /** |
||
| 1153 | * Get chatcallUserId |
||
| 1154 | * |
||
| 1155 | * @return integer |
||
| 1156 | */ |
||
| 1157 | public function getChatcallUserId() |
||
| 1161 | |||
| 1162 | /** |
||
| 1163 | * Set chatcallDate |
||
| 1164 | * |
||
| 1165 | * @param \DateTime $chatcallDate |
||
| 1166 | * @return User |
||
| 1167 | */ |
||
| 1168 | public function setChatcallDate($chatcallDate) |
||
| 1174 | |||
| 1175 | /** |
||
| 1176 | * Get chatcallDate |
||
| 1177 | * |
||
| 1178 | * @return \DateTime |
||
| 1179 | */ |
||
| 1180 | public function getChatcallDate() |
||
| 1184 | |||
| 1185 | /** |
||
| 1186 | * Set chatcallText |
||
| 1187 | * |
||
| 1188 | * @param string $chatcallText |
||
| 1189 | * @return User |
||
| 1190 | */ |
||
| 1191 | public function setChatcallText($chatcallText) |
||
| 1197 | |||
| 1198 | /** |
||
| 1199 | * Get chatcallText |
||
| 1200 | * |
||
| 1201 | * @return string |
||
| 1202 | */ |
||
| 1203 | public function getChatcallText() |
||
| 1207 | |||
| 1208 | /** |
||
| 1209 | * Set language |
||
| 1210 | * |
||
| 1211 | * @param string $language |
||
| 1212 | * @return User |
||
| 1213 | */ |
||
| 1214 | public function setLanguage($language) |
||
| 1220 | |||
| 1221 | /** |
||
| 1222 | * Get language |
||
| 1223 | * |
||
| 1224 | * @return string |
||
| 1225 | */ |
||
| 1226 | public function getLanguage() |
||
| 1230 | |||
| 1231 | /** |
||
| 1232 | * Set registrationDate |
||
| 1233 | * |
||
| 1234 | * @param \DateTime $registrationDate |
||
| 1235 | * @return User |
||
| 1236 | */ |
||
| 1237 | public function setRegistrationDate($registrationDate) |
||
| 1243 | |||
| 1244 | /** |
||
| 1245 | * Get registrationDate |
||
| 1246 | * |
||
| 1247 | * @return \DateTime |
||
| 1248 | */ |
||
| 1249 | public function getRegistrationDate() |
||
| 1253 | |||
| 1254 | /** |
||
| 1255 | * Set expirationDate |
||
| 1256 | * |
||
| 1257 | * @param \DateTime $expirationDate |
||
| 1258 | * |
||
| 1259 | * @return User |
||
| 1260 | */ |
||
| 1261 | public function setExpirationDate($expirationDate) |
||
| 1267 | |||
| 1268 | /** |
||
| 1269 | * Get expirationDate |
||
| 1270 | * |
||
| 1271 | * @return \DateTime |
||
| 1272 | */ |
||
| 1273 | public function getExpirationDate() |
||
| 1277 | |||
| 1278 | /** |
||
| 1279 | * Set active |
||
| 1280 | * |
||
| 1281 | * @param boolean $active |
||
| 1282 | * @return User |
||
| 1283 | */ |
||
| 1284 | public function setActive($active) |
||
| 1290 | |||
| 1291 | /** |
||
| 1292 | * Get active |
||
| 1293 | * |
||
| 1294 | * @return boolean |
||
| 1295 | */ |
||
| 1296 | public function getActive() |
||
| 1300 | |||
| 1301 | /** |
||
| 1302 | * Set openid |
||
| 1303 | * |
||
| 1304 | * @param string $openid |
||
| 1305 | * @return User |
||
| 1306 | */ |
||
| 1307 | public function setOpenid($openid) |
||
| 1313 | |||
| 1314 | /** |
||
| 1315 | * Get openid |
||
| 1316 | * |
||
| 1317 | * @return string |
||
| 1318 | */ |
||
| 1319 | public function getOpenid() |
||
| 1323 | |||
| 1324 | /** |
||
| 1325 | * Set theme |
||
| 1326 | * |
||
| 1327 | * @param string $theme |
||
| 1328 | * @return User |
||
| 1329 | */ |
||
| 1330 | public function setTheme($theme) |
||
| 1336 | |||
| 1337 | /** |
||
| 1338 | * Get theme |
||
| 1339 | * |
||
| 1340 | * @return string |
||
| 1341 | */ |
||
| 1342 | public function getTheme() |
||
| 1346 | |||
| 1347 | /** |
||
| 1348 | * Set hrDeptId |
||
| 1349 | * |
||
| 1350 | * @param integer $hrDeptId |
||
| 1351 | * @return User |
||
| 1352 | */ |
||
| 1353 | public function setHrDeptId($hrDeptId) |
||
| 1359 | |||
| 1360 | /** |
||
| 1361 | * Get hrDeptId |
||
| 1362 | * |
||
| 1363 | * @return integer |
||
| 1364 | */ |
||
| 1365 | public function getHrDeptId() |
||
| 1369 | |||
| 1370 | /** |
||
| 1371 | * @return Media |
||
| 1372 | */ |
||
| 1373 | public function getAvatar() |
||
| 1377 | |||
| 1378 | /** |
||
| 1379 | * @return \DateTime |
||
| 1380 | */ |
||
| 1381 | public function getMemberSince() |
||
| 1385 | |||
| 1386 | /** |
||
| 1387 | * @return bool |
||
| 1388 | */ |
||
| 1389 | public function isOnline() |
||
| 1393 | |||
| 1394 | /** |
||
| 1395 | * @return int |
||
| 1396 | */ |
||
| 1397 | public function getIdentifier() |
||
| 1401 | |||
| 1402 | /** |
||
| 1403 | * If manually uploading a file (i.e. not using Symfony Form) ensure an instance |
||
| 1404 | * of 'UploadedFile' is injected into this setter to trigger the update. If this |
||
| 1405 | * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter |
||
| 1406 | * must be able to accept an instance of 'File' as the bundle will inject one here |
||
| 1407 | * during Doctrine hydration. |
||
| 1408 | * |
||
| 1409 | * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image |
||
| 1410 | */ |
||
| 1411 | public function setImageFile(File $image) |
||
| 1421 | |||
| 1422 | /** |
||
| 1423 | * @return File |
||
| 1424 | */ |
||
| 1425 | public function getImageFile() |
||
| 1429 | |||
| 1430 | /** |
||
| 1431 | * @param string $imageName |
||
| 1432 | */ |
||
| 1433 | public function setImageName($imageName) |
||
| 1437 | |||
| 1438 | /** |
||
| 1439 | * @return string |
||
| 1440 | */ |
||
| 1441 | public function getImageName() |
||
| 1445 | |||
| 1446 | /** |
||
| 1447 | * @return string |
||
| 1448 | */ |
||
| 1449 | public function getSlug() |
||
| 1453 | |||
| 1454 | /** |
||
| 1455 | * @param $slug |
||
| 1456 | * @return User |
||
| 1457 | */ |
||
| 1458 | public function setSlug($slug) |
||
| 1462 | |||
| 1463 | /** |
||
| 1464 | * Set lastLogin |
||
| 1465 | * |
||
| 1466 | * @param \DateTime $lastLogin |
||
| 1467 | * |
||
| 1468 | * @return User |
||
| 1469 | */ |
||
| 1470 | public function setLastLogin(\DateTime $lastLogin) |
||
| 1476 | |||
| 1477 | /** |
||
| 1478 | * Get lastLogin |
||
| 1479 | * |
||
| 1480 | * @return \DateTime |
||
| 1481 | */ |
||
| 1482 | public function getLastLogin() |
||
| 1486 | |||
| 1487 | /** |
||
| 1488 | * {@inheritdoc} |
||
| 1489 | */ |
||
| 1490 | public function getExtraFields() |
||
| 1494 | |||
| 1495 | /** |
||
| 1496 | * {@inheritdoc} |
||
| 1497 | */ |
||
| 1498 | public function setExtraFields($extraFields) |
||
| 1507 | |||
| 1508 | /** |
||
| 1509 | * {@inheritdoc} |
||
| 1510 | */ |
||
| 1511 | /*public function addExtraFields(ExtraFieldValues $extraFieldValue) |
||
| 1512 | { |
||
| 1513 | $extraFieldValue->setUser($this); |
||
| 1514 | $this->extraFields[] = $extraFieldValue; |
||
| 1515 | |||
| 1516 | return $this; |
||
| 1517 | }*/ |
||
| 1518 | |||
| 1519 | /** |
||
| 1520 | * {@inheritdoc} |
||
| 1521 | */ |
||
| 1522 | public function addExtraFields(ExtraFieldValues $extraFieldValue) |
||
| 1531 | |||
| 1532 | /** |
||
| 1533 | * {@inheritdoc} |
||
| 1534 | */ |
||
| 1535 | public function removeExtraField(ExtraFieldValues $attribute) |
||
| 1544 | |||
| 1545 | /** |
||
| 1546 | * {@inheritdoc} |
||
| 1547 | */ |
||
| 1548 | /*public function hasExtraField($attribute) |
||
| 1549 | { |
||
| 1550 | if (!$this->extraFields) { |
||
| 1551 | return false; |
||
| 1552 | } |
||
| 1553 | return $this->extraFields->contains($attribute); |
||
| 1554 | }*/ |
||
| 1555 | |||
| 1556 | /** |
||
| 1557 | * {@inheritdoc} |
||
| 1558 | */ |
||
| 1559 | public function hasExtraFieldByName($attributeName) |
||
| 1569 | |||
| 1570 | /** |
||
| 1571 | * {@inheritdoc} |
||
| 1572 | */ |
||
| 1573 | public function getExtraFieldByName($attributeName) |
||
| 1583 | |||
| 1584 | /** |
||
| 1585 | * Get sessionCourseSubscription |
||
| 1586 | * @return ArrayCollection |
||
| 1587 | */ |
||
| 1588 | public function getSessionCourseSubscriptions() |
||
| 1592 | |||
| 1593 | /** |
||
| 1594 | * @return string |
||
| 1595 | */ |
||
| 1596 | public function getConfirmationToken() |
||
| 1600 | |||
| 1601 | /** |
||
| 1602 | * @param string $confirmationToken |
||
| 1603 | * |
||
| 1604 | * @return User |
||
| 1605 | */ |
||
| 1606 | public function setConfirmationToken($confirmationToken) |
||
| 1612 | |||
| 1613 | /** |
||
| 1614 | * @return \DateTime |
||
| 1615 | */ |
||
| 1616 | public function getPasswordRequestedAt() |
||
| 1620 | |||
| 1621 | |||
| 1622 | /** |
||
| 1623 | * @param int $ttl |
||
| 1624 | * @return bool |
||
| 1625 | */ |
||
| 1626 | public function isPasswordRequestNonExpired($ttl) |
||
| 1631 | |||
| 1632 | public function getUsername() |
||
| 1636 | |||
| 1637 | /** |
||
| 1638 | * Returns the creation date. |
||
| 1639 | * |
||
| 1640 | * @return \DateTime|null |
||
| 1641 | */ |
||
| 1642 | public function getCreatedAt() |
||
| 1646 | |||
| 1647 | /** |
||
| 1648 | * Sets the last update date. |
||
| 1649 | * |
||
| 1650 | * @param \DateTime|null $updatedAt |
||
| 1651 | * |
||
| 1652 | * @return User |
||
| 1653 | */ |
||
| 1654 | public function setUpdatedAt(\DateTime $updatedAt = null) |
||
| 1660 | |||
| 1661 | /** |
||
| 1662 | * Returns the last update date. |
||
| 1663 | * |
||
| 1664 | * @return \DateTime|null |
||
| 1665 | */ |
||
| 1666 | public function getUpdatedAt() |
||
| 1670 | |||
| 1671 | /** |
||
| 1672 | * Returns the expiration date. |
||
| 1673 | * |
||
| 1674 | * @return \DateTime|null |
||
| 1675 | */ |
||
| 1676 | public function getExpiresAt() |
||
| 1680 | |||
| 1681 | /** |
||
| 1682 | * Returns the credentials expiration date. |
||
| 1683 | * |
||
| 1684 | * @return \DateTime |
||
| 1685 | */ |
||
| 1686 | public function getCredentialsExpireAt() |
||
| 1690 | |||
| 1691 | /** |
||
| 1692 | * Sets the credentials expiration date. |
||
| 1693 | * |
||
| 1694 | * @param \DateTime|null $date |
||
| 1695 | * |
||
| 1696 | * @return User |
||
| 1697 | */ |
||
| 1698 | public function setCredentialsExpireAt(\DateTime $date = null) |
||
| 1704 | |||
| 1705 | /** |
||
| 1706 | * Sets the user groups. |
||
| 1707 | * |
||
| 1708 | * @param array $groups |
||
| 1709 | * |
||
| 1710 | * @return User |
||
| 1711 | */ |
||
| 1712 | public function setGroups($groups) |
||
| 1720 | |||
| 1721 | /** |
||
| 1722 | * Sets the two-step verification code. |
||
| 1723 | * |
||
| 1724 | * @param string $twoStepVerificationCode |
||
| 1725 | * |
||
| 1726 | * @return User |
||
| 1727 | */ |
||
| 1728 | public function setTwoStepVerificationCode($twoStepVerificationCode) |
||
| 1734 | |||
| 1735 | /** |
||
| 1736 | * Returns the two-step verification code. |
||
| 1737 | * |
||
| 1738 | * @return string |
||
| 1739 | */ |
||
| 1740 | public function getTwoStepVerificationCode() |
||
| 1744 | |||
| 1745 | /** |
||
| 1746 | * @param string $biography |
||
| 1747 | * |
||
| 1748 | * @return User |
||
| 1749 | */ |
||
| 1750 | public function setBiography($biography) |
||
| 1756 | |||
| 1757 | /** |
||
| 1758 | * @return string |
||
| 1759 | */ |
||
| 1760 | public function getBiography() |
||
| 1764 | |||
| 1765 | /** |
||
| 1766 | * @param \DateTime $dateOfBirth |
||
| 1767 | * |
||
| 1768 | * @return User |
||
| 1769 | */ |
||
| 1770 | public function setDateOfBirth($dateOfBirth) |
||
| 1776 | |||
| 1777 | /** |
||
| 1778 | * @return \DateTime |
||
| 1779 | */ |
||
| 1780 | public function getDateOfBirth() |
||
| 1784 | |||
| 1785 | /** |
||
| 1786 | * @param string $facebookData |
||
| 1787 | * |
||
| 1788 | * @return User |
||
| 1789 | */ |
||
| 1790 | public function setFacebookData($facebookData) |
||
| 1796 | |||
| 1797 | /** |
||
| 1798 | * @return string |
||
| 1799 | */ |
||
| 1800 | public function getFacebookData() |
||
| 1804 | |||
| 1805 | /** |
||
| 1806 | * @param string $facebookName |
||
| 1807 | * |
||
| 1808 | * @return User |
||
| 1809 | */ |
||
| 1810 | public function setFacebookName($facebookName) |
||
| 1816 | |||
| 1817 | /** |
||
| 1818 | * @return string |
||
| 1819 | */ |
||
| 1820 | public function getFacebookName() |
||
| 1824 | |||
| 1825 | /** |
||
| 1826 | * @param string $facebookUid |
||
| 1827 | * |
||
| 1828 | * @return User |
||
| 1829 | */ |
||
| 1830 | public function setFacebookUid($facebookUid) |
||
| 1836 | |||
| 1837 | /** |
||
| 1838 | * @return string |
||
| 1839 | */ |
||
| 1840 | public function getFacebookUid() |
||
| 1844 | |||
| 1845 | /** |
||
| 1846 | * @return string |
||
| 1847 | */ |
||
| 1848 | public function getFirstname() |
||
| 1852 | |||
| 1853 | /** |
||
| 1854 | * @param string $gender |
||
| 1855 | * |
||
| 1856 | * @return User |
||
| 1857 | */ |
||
| 1858 | public function setGender($gender) |
||
| 1864 | |||
| 1865 | /** |
||
| 1866 | * @return string |
||
| 1867 | */ |
||
| 1868 | public function getGender() |
||
| 1872 | |||
| 1873 | /** |
||
| 1874 | * @param string $gplusData |
||
| 1875 | * |
||
| 1876 | * @return User |
||
| 1877 | */ |
||
| 1878 | public function setGplusData($gplusData) |
||
| 1884 | |||
| 1885 | /** |
||
| 1886 | * @return string |
||
| 1887 | */ |
||
| 1888 | public function getGplusData() |
||
| 1892 | |||
| 1893 | /** |
||
| 1894 | * @param string $gplusName |
||
| 1895 | * |
||
| 1896 | * @return User |
||
| 1897 | */ |
||
| 1898 | public function setGplusName($gplusName) |
||
| 1904 | |||
| 1905 | /** |
||
| 1906 | * @return string |
||
| 1907 | */ |
||
| 1908 | public function getGplusName() |
||
| 1912 | |||
| 1913 | /** |
||
| 1914 | * @param string $gplusUid |
||
| 1915 | * |
||
| 1916 | * @return User |
||
| 1917 | */ |
||
| 1918 | public function setGplusUid($gplusUid) |
||
| 1924 | |||
| 1925 | /** |
||
| 1926 | * @return string |
||
| 1927 | */ |
||
| 1928 | public function getGplusUid() |
||
| 1932 | |||
| 1933 | |||
| 1934 | /** |
||
| 1935 | * @return string |
||
| 1936 | */ |
||
| 1937 | public function getLastname() |
||
| 1941 | |||
| 1942 | /** |
||
| 1943 | * @param string $locale |
||
| 1944 | * |
||
| 1945 | * @return User |
||
| 1946 | */ |
||
| 1947 | public function setLocale($locale) |
||
| 1953 | |||
| 1954 | /** |
||
| 1955 | * @return string |
||
| 1956 | */ |
||
| 1957 | public function getLocale() |
||
| 1961 | |||
| 1962 | /** |
||
| 1963 | * @param string $timezone |
||
| 1964 | * |
||
| 1965 | * @return User |
||
| 1966 | */ |
||
| 1967 | public function setTimezone($timezone) |
||
| 1973 | |||
| 1974 | /** |
||
| 1975 | * @return string |
||
| 1976 | */ |
||
| 1977 | public function getTimezone() |
||
| 1981 | |||
| 1982 | /** |
||
| 1983 | * @param string $twitterData |
||
| 1984 | * |
||
| 1985 | * @return User |
||
| 1986 | */ |
||
| 1987 | public function setTwitterData($twitterData) |
||
| 1993 | |||
| 1994 | /** |
||
| 1995 | * @return string |
||
| 1996 | */ |
||
| 1997 | public function getTwitterData() |
||
| 2001 | |||
| 2002 | /** |
||
| 2003 | * @param string $twitterName |
||
| 2004 | * |
||
| 2005 | * @return User |
||
| 2006 | */ |
||
| 2007 | public function setTwitterName($twitterName) |
||
| 2013 | |||
| 2014 | /** |
||
| 2015 | * @return string |
||
| 2016 | */ |
||
| 2017 | public function getTwitterName() |
||
| 2021 | |||
| 2022 | /** |
||
| 2023 | * @param string $twitterUid |
||
| 2024 | * |
||
| 2025 | * @return User |
||
| 2026 | */ |
||
| 2027 | public function setTwitterUid($twitterUid) |
||
| 2033 | |||
| 2034 | /** |
||
| 2035 | * @return string |
||
| 2036 | */ |
||
| 2037 | public function getTwitterUid() |
||
| 2041 | |||
| 2042 | /** |
||
| 2043 | * @param string $website |
||
| 2044 | * |
||
| 2045 | * @return User |
||
| 2046 | */ |
||
| 2047 | public function setWebsite($website) |
||
| 2053 | |||
| 2054 | /** |
||
| 2055 | * @return string |
||
| 2056 | */ |
||
| 2057 | public function getWebsite() |
||
| 2061 | |||
| 2062 | /** |
||
| 2063 | * @param string $token |
||
| 2064 | * |
||
| 2065 | * @return User |
||
| 2066 | */ |
||
| 2067 | public function setToken($token) |
||
| 2073 | |||
| 2074 | /** |
||
| 2075 | * @return string |
||
| 2076 | */ |
||
| 2077 | public function getToken() |
||
| 2081 | |||
| 2082 | /** |
||
| 2083 | * @return string |
||
| 2084 | */ |
||
| 2085 | public function getFullname() |
||
| 2089 | |||
| 2090 | /** |
||
| 2091 | * @return array |
||
| 2092 | */ |
||
| 2093 | public function getRealRoles() |
||
| 2097 | |||
| 2098 | /** |
||
| 2099 | * @param array $roles |
||
| 2100 | * |
||
| 2101 | * @return User |
||
| 2102 | */ |
||
| 2103 | public function setRealRoles(array $roles) |
||
| 2109 | |||
| 2110 | /** |
||
| 2111 | * Removes sensitive data from the user. |
||
| 2112 | */ |
||
| 2113 | public function eraseCredentials() |
||
| 2117 | |||
| 2118 | |||
| 2119 | public function getUsernameCanonical() |
||
| 2123 | |||
| 2124 | |||
| 2125 | public function getEmailCanonical() |
||
| 2129 | |||
| 2130 | public function getPlainPassword() |
||
| 2136 | |||
| 2137 | /** |
||
| 2138 | * Returns the user roles |
||
| 2139 | * |
||
| 2140 | * @return array The roles |
||
| 2141 | */ |
||
| 2142 | View Code Duplication | public function getRoles() |
|
| 2155 | |||
| 2156 | /** |
||
| 2157 | * Never use this to check if this user has access to anything! |
||
| 2158 | * |
||
| 2159 | * Use the SecurityContext, or an implementation of AccessDecisionManager |
||
| 2160 | * instead, e.g. |
||
| 2161 | * |
||
| 2162 | * $securityContext->isGranted('ROLE_USER'); |
||
| 2163 | * |
||
| 2164 | * @param string $role |
||
| 2165 | * |
||
| 2166 | * @return boolean |
||
| 2167 | */ |
||
| 2168 | public function hasRole($role) |
||
| 2172 | |||
| 2173 | View Code Duplication | public function isAccountNonExpired() |
|
| 2185 | |||
| 2186 | public function isAccountNonLocked() |
||
| 2190 | |||
| 2191 | View Code Duplication | public function isCredentialsNonExpired() |
|
| 2203 | |||
| 2204 | public function isCredentialsExpired() |
||
| 2208 | |||
| 2209 | public function isExpired() |
||
| 2213 | |||
| 2214 | public function isLocked() |
||
| 2218 | |||
| 2219 | public function isSuperAdmin() |
||
| 2223 | |||
| 2224 | public function isUser(UserInterface $user = null) |
||
| 2228 | |||
| 2229 | View Code Duplication | public function removeRole($role) |
|
| 2238 | |||
| 2239 | public function setUsername($username) |
||
| 2245 | |||
| 2246 | public function setUsernameCanonical($usernameCanonical) |
||
| 2252 | |||
| 2253 | |||
| 2254 | /** |
||
| 2255 | * @param boolean $boolean |
||
| 2256 | * |
||
| 2257 | * @return User |
||
| 2258 | */ |
||
| 2259 | public function setCredentialsExpired($boolean) |
||
| 2265 | |||
| 2266 | public function setEmailCanonical($emailCanonical) |
||
| 2272 | |||
| 2273 | public function setEnabled($boolean) |
||
| 2279 | |||
| 2280 | /** |
||
| 2281 | * Sets this user to expired. |
||
| 2282 | * |
||
| 2283 | * @param Boolean $boolean |
||
| 2284 | * |
||
| 2285 | * @return User |
||
| 2286 | */ |
||
| 2287 | public function setExpired($boolean) |
||
| 2293 | |||
| 2294 | /** |
||
| 2295 | * @param \DateTime $date |
||
| 2296 | * |
||
| 2297 | * @return User |
||
| 2298 | */ |
||
| 2299 | public function setExpiresAt(\DateTime $date) |
||
| 2305 | |||
| 2306 | View Code Duplication | public function setSuperAdmin($boolean) |
|
| 2316 | |||
| 2317 | public function setPlainPassword($password) |
||
| 2323 | |||
| 2324 | public function setLocked($boolean) |
||
| 2330 | |||
| 2331 | public function setPasswordRequestedAt(\DateTime $date = null) |
||
| 2337 | |||
| 2338 | |||
| 2339 | public function setRoles(array $roles) |
||
| 2349 | |||
| 2350 | /** |
||
| 2351 | * Gets the groups granted to the user. |
||
| 2352 | * |
||
| 2353 | * @return Collection |
||
| 2354 | */ |
||
| 2355 | public function getGroups() |
||
| 2359 | |||
| 2360 | public function getGroupNames() |
||
| 2369 | |||
| 2370 | public function hasGroup($name) |
||
| 2374 | |||
| 2375 | public function addGroup(GroupInterface $group) |
||
| 2383 | |||
| 2384 | public function removeGroup(GroupInterface $group) |
||
| 2392 | |||
| 2393 | View Code Duplication | public function addRole($role) |
|
| 2406 | |||
| 2407 | /** |
||
| 2408 | * Serializes the user. |
||
| 2409 | * |
||
| 2410 | * The serialized data have to contain the fields used by the equals method and the username. |
||
| 2411 | * |
||
| 2412 | * @return string |
||
| 2413 | */ |
||
| 2414 | View Code Duplication | public function serialize() |
|
| 2428 | |||
| 2429 | /** |
||
| 2430 | * Unserializes the user. |
||
| 2431 | * |
||
| 2432 | * @param string $serialized |
||
| 2433 | */ |
||
| 2434 | View Code Duplication | public function unserialize($serialized) |
|
| 2453 | |||
| 2454 | /** |
||
| 2455 | * Get achievedSkills |
||
| 2456 | * @return ArrayCollection |
||
| 2457 | */ |
||
| 2458 | public function getAchievedSkills() |
||
| 2462 | |||
| 2463 | /** |
||
| 2464 | * Check if the user has the skill |
||
| 2465 | * @param \Chamilo\CoreBundle\Entity\Skill $skill The skill |
||
| 2466 | * @return boolean |
||
| 2467 | */ |
||
| 2468 | public function hasSkill(\Chamilo\CoreBundle\Entity\Skill $skill) |
||
| 2479 | } |
||
| 2480 |
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.