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 |
||
| 51 | class User extends BaseUser implements ThemeUser |
||
| 52 | { |
||
| 53 | const COURSE_MANAGER = 1; |
||
| 54 | const TEACHER = 1; |
||
| 55 | const SESSION_ADMIN = 3; |
||
| 56 | const DRH = 4; |
||
| 57 | const STUDENT = 5; |
||
| 58 | const ANONYMOUS = 6; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @var integer |
||
| 62 | * |
||
| 63 | * @ORM\Column(name="id", type="integer") |
||
| 64 | * @ORM\Id |
||
| 65 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 66 | */ |
||
| 67 | protected $id; |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @var integer |
||
| 71 | * |
||
| 72 | * @ORM\Column(name="user_id", type="integer", nullable=true) |
||
| 73 | */ |
||
| 74 | protected $userId; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @var string |
||
| 78 | * |
||
| 79 | * @ORM\Column(name="username", type="string", length=100, nullable=false, unique=true) |
||
| 80 | */ |
||
| 81 | //protected $username; |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @var string |
||
| 85 | * |
||
| 86 | * @ORM\Column(name="username_canonical", type="string", length=100, nullable=false) |
||
| 87 | */ |
||
| 88 | //protected $usernameCanonical; |
||
| 89 | |||
| 90 | /** |
||
| 91 | * @var string |
||
| 92 | * @ORM\Column(name="email_canonical", type="string", length=100, nullable=false, unique=false) |
||
| 93 | */ |
||
| 94 | //protected $emailCanonical; |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @var string |
||
| 98 | * |
||
| 99 | * @ORM\Column(name="email", type="string", length=100, nullable=false, unique=false) |
||
| 100 | */ |
||
| 101 | //protected $email; |
||
| 102 | |||
| 103 | /** |
||
| 104 | * @var boolean |
||
| 105 | * @ORM\Column(name="locked", type="boolean") |
||
| 106 | */ |
||
| 107 | //protected $locked; |
||
| 108 | |||
| 109 | /** |
||
| 110 | * @var boolean |
||
| 111 | * @ORM\Column(name="enabled", type="boolean") |
||
| 112 | */ |
||
| 113 | //protected $enabled; |
||
| 114 | |||
| 115 | /** |
||
| 116 | * @var boolean |
||
| 117 | * @ORM\Column(name="expired", type="boolean") |
||
| 118 | */ |
||
| 119 | //protected $expired; |
||
| 120 | |||
| 121 | /** |
||
| 122 | * @var boolean |
||
| 123 | * @ORM\Column(name="credentials_expired", type="boolean") |
||
| 124 | */ |
||
| 125 | //protected $credentialsExpired; |
||
| 126 | |||
| 127 | /** |
||
| 128 | * @var \DateTime |
||
| 129 | * @ORM\Column(name="credentials_expire_at", type="datetime", nullable=true, unique=false) |
||
| 130 | */ |
||
| 131 | //protected $credentialsExpireAt; |
||
| 132 | |||
| 133 | /** |
||
| 134 | * @var \DateTime |
||
| 135 | * @ORM\Column(name="expires_at", type="datetime", nullable=true, unique=false) |
||
| 136 | */ |
||
| 137 | //protected $expiresAt; |
||
| 138 | |||
| 139 | /** |
||
| 140 | * @var string |
||
| 141 | * |
||
| 142 | * @ORM\Column(name="lastname", type="string", length=60, nullable=true, unique=false) |
||
| 143 | */ |
||
| 144 | protected $lastname; |
||
| 145 | |||
| 146 | /** |
||
| 147 | * @var string |
||
| 148 | * |
||
| 149 | * @ORM\Column(name="firstname", type="string", length=60, nullable=true, unique=false) |
||
| 150 | */ |
||
| 151 | protected $firstname; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @var string |
||
| 155 | * |
||
| 156 | * @ORM\Column(name="password", type="string", length=255, nullable=false, unique=false) |
||
| 157 | */ |
||
| 158 | //protected $password; |
||
| 159 | |||
| 160 | /** |
||
| 161 | * @var string |
||
| 162 | * |
||
| 163 | * @ORM\Column(name="auth_source", type="string", length=50, nullable=true, unique=false) |
||
| 164 | */ |
||
| 165 | private $authSource; |
||
| 166 | |||
| 167 | /** |
||
| 168 | * @var boolean |
||
| 169 | * |
||
| 170 | * @ORM\Column(name="status", type="integer", nullable=false) |
||
| 171 | */ |
||
| 172 | private $status; |
||
| 173 | |||
| 174 | /** |
||
| 175 | * @var string |
||
| 176 | * |
||
| 177 | * @ORM\Column(name="official_code", type="string", length=40, nullable=true, unique=false) |
||
| 178 | */ |
||
| 179 | private $officialCode; |
||
| 180 | |||
| 181 | /** |
||
| 182 | * @var string |
||
| 183 | * |
||
| 184 | * @ORM\Column(name="phone", type="string", length=30, nullable=true, unique=false) |
||
| 185 | */ |
||
| 186 | protected $phone; |
||
| 187 | |||
| 188 | /** |
||
| 189 | * @var string |
||
| 190 | * |
||
| 191 | * @ORM\Column(name="address", type="string", length=250, nullable=true, unique=false) |
||
| 192 | */ |
||
| 193 | protected $address; |
||
| 194 | |||
| 195 | /** |
||
| 196 | * Vich\UploadableField(mapping="user_image", fileNameProperty="picture_uri") |
||
| 197 | * |
||
| 198 | * note This is not a mapped field of entity metadata, just a simple property. |
||
| 199 | * |
||
| 200 | * @var File $imageFile |
||
| 201 | */ |
||
| 202 | protected $imageFile; |
||
| 203 | |||
| 204 | /** |
||
| 205 | * @var string |
||
| 206 | * @ORM\Column(name="picture_uri", type="string", length=250, nullable=true, unique=false) |
||
| 207 | */ |
||
| 208 | private $pictureUri; |
||
| 209 | |||
| 210 | /** |
||
| 211 | * ORM\ManyToOne(targetEntity="Application\Sonata\MediaBundle\Entity\Media", cascade={"all"} ) |
||
| 212 | * @ORM\JoinColumn(name="picture_uri", referencedColumnName="id") |
||
| 213 | */ |
||
| 214 | //protected $pictureUri; |
||
| 215 | |||
| 216 | /** |
||
| 217 | * @var integer |
||
| 218 | * |
||
| 219 | * @ORM\Column(name="creator_id", type="integer", nullable=true, unique=false) |
||
| 220 | */ |
||
| 221 | private $creatorId; |
||
| 222 | |||
| 223 | /** |
||
| 224 | * @var string |
||
| 225 | * |
||
| 226 | * @ORM\Column(name="competences", type="text", nullable=true, unique=false) |
||
| 227 | */ |
||
| 228 | private $competences; |
||
| 229 | |||
| 230 | /** |
||
| 231 | * @var string |
||
| 232 | * |
||
| 233 | * @ORM\Column(name="diplomas", type="text", nullable=true, unique=false) |
||
| 234 | */ |
||
| 235 | private $diplomas; |
||
| 236 | |||
| 237 | /** |
||
| 238 | * @var string |
||
| 239 | * |
||
| 240 | * @ORM\Column(name="openarea", type="text", nullable=true, unique=false) |
||
| 241 | */ |
||
| 242 | private $openarea; |
||
| 243 | |||
| 244 | /** |
||
| 245 | * @var string |
||
| 246 | * |
||
| 247 | * @ORM\Column(name="teach", type="text", nullable=true, unique=false) |
||
| 248 | */ |
||
| 249 | private $teach; |
||
| 250 | |||
| 251 | /** |
||
| 252 | * @var string |
||
| 253 | * |
||
| 254 | * @ORM\Column(name="productions", type="string", length=250, nullable=true, unique=false) |
||
| 255 | */ |
||
| 256 | private $productions; |
||
| 257 | |||
| 258 | /** |
||
| 259 | * @var string |
||
| 260 | * |
||
| 261 | * @ORM\Column(name="language", type="string", length=40, nullable=true, unique=false) |
||
| 262 | */ |
||
| 263 | private $language; |
||
| 264 | |||
| 265 | /** |
||
| 266 | * @var \DateTime |
||
| 267 | * |
||
| 268 | * @ORM\Column(name="registration_date", type="datetime", nullable=false, unique=false) |
||
| 269 | */ |
||
| 270 | private $registrationDate; |
||
| 271 | |||
| 272 | /** |
||
| 273 | * @var \DateTime |
||
| 274 | * |
||
| 275 | * @ORM\Column(name="expiration_date", type="datetime", nullable=true, unique=false) |
||
| 276 | */ |
||
| 277 | private $expirationDate; |
||
| 278 | |||
| 279 | /** |
||
| 280 | * @var boolean |
||
| 281 | * |
||
| 282 | * @ORM\Column(name="active", type="boolean", nullable=false, unique=false) |
||
| 283 | */ |
||
| 284 | private $active; |
||
| 285 | |||
| 286 | /** |
||
| 287 | * @var string |
||
| 288 | * |
||
| 289 | * @ORM\Column(name="openid", type="string", length=255, nullable=true, unique=false) |
||
| 290 | */ |
||
| 291 | private $openid; |
||
| 292 | |||
| 293 | /** |
||
| 294 | * @var string |
||
| 295 | * |
||
| 296 | * @ORM\Column(name="theme", type="string", length=255, nullable=true, unique=false) |
||
| 297 | */ |
||
| 298 | private $theme; |
||
| 299 | |||
| 300 | /** |
||
| 301 | * @var integer |
||
| 302 | * |
||
| 303 | * @ORM\Column(name="hr_dept_id", type="smallint", nullable=true, unique=false) |
||
| 304 | */ |
||
| 305 | private $hrDeptId; |
||
| 306 | |||
| 307 | /** |
||
| 308 | * @var AccessUrl |
||
| 309 | **/ |
||
| 310 | protected $currentUrl; |
||
| 311 | |||
| 312 | /** |
||
| 313 | * @ORM\Column(type="string", length=255) |
||
| 314 | */ |
||
| 315 | //protected $salt; |
||
| 316 | |||
| 317 | /** |
||
| 318 | * @var \DateTime |
||
| 319 | * |
||
| 320 | * @ORM\Column(name="last_login", type="datetime", nullable=true, unique=false) |
||
| 321 | */ |
||
| 322 | //protected $lastLogin; |
||
| 323 | |||
| 324 | /** |
||
| 325 | * @ORM\Column(name="facebook_id", type="string", length=255, nullable=true) |
||
| 326 | */ |
||
| 327 | protected $facebookId; |
||
| 328 | |||
| 329 | /** |
||
| 330 | * @ORM\Column(name="facebook_access_token", type="string", length=255, nullable=true) |
||
| 331 | */ |
||
| 332 | protected $facebookAccessToken; |
||
| 333 | |||
| 334 | /** |
||
| 335 | * @ORM\Column(name="google_id", type="string", length=255, nullable=true) |
||
| 336 | */ |
||
| 337 | protected $googleId; |
||
| 338 | |||
| 339 | /** |
||
| 340 | * @ORM\Column(name="google_access_token", type="string", length=255, nullable=true) |
||
| 341 | */ |
||
| 342 | protected $googleAccessToken; |
||
| 343 | |||
| 344 | /** |
||
| 345 | * @ORM\Column(name="github_id", type="string", length=255, nullable=true) |
||
| 346 | */ |
||
| 347 | protected $githubId; |
||
| 348 | |||
| 349 | /** |
||
| 350 | * @ORM\Column(name="github_access_token", type="string", length=255, nullable=true) |
||
| 351 | */ |
||
| 352 | protected $githubAccessToken; |
||
| 353 | |||
| 354 | /** |
||
| 355 | * @var \DateTime |
||
| 356 | * @ORM\Column(name="created_at", type="datetime", nullable=true, unique=false) |
||
| 357 | */ |
||
| 358 | protected $createdAt; |
||
| 359 | |||
| 360 | /** |
||
| 361 | * @var \DateTime |
||
| 362 | * @ORM\Column(name="updated_at", type="datetime", nullable=true, unique=false) |
||
| 363 | */ |
||
| 364 | protected $updatedAt; |
||
| 365 | |||
| 366 | /** |
||
| 367 | * Random string sent to the user email address in order to verify it |
||
| 368 | * |
||
| 369 | * @var string |
||
| 370 | * @ORM\Column(name="confirmation_token", type="string", length=255, nullable=true) |
||
| 371 | */ |
||
| 372 | //protected $confirmationToken; |
||
| 373 | |||
| 374 | /** |
||
| 375 | * @var \DateTime |
||
| 376 | * |
||
| 377 | * @ORM\Column(name="password_requested_at", type="datetime", nullable=true, unique=false) |
||
| 378 | */ |
||
| 379 | //protected $passwordRequestedAt; |
||
| 380 | |||
| 381 | /** |
||
| 382 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\CourseRelUser", mappedBy="user") |
||
| 383 | **/ |
||
| 384 | protected $courses; |
||
| 385 | |||
| 386 | /** |
||
| 387 | * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CItemProperty", mappedBy="user") |
||
| 388 | **/ |
||
| 389 | //protected $items; |
||
| 390 | |||
| 391 | /** |
||
| 392 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\UsergroupRelUser", mappedBy="user") |
||
| 393 | **/ |
||
| 394 | protected $classes; |
||
| 395 | |||
| 396 | /** |
||
| 397 | * ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CDropboxPost", mappedBy="user") |
||
| 398 | **/ |
||
| 399 | protected $dropBoxReceivedFiles; |
||
| 400 | |||
| 401 | /** |
||
| 402 | * ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CDropboxFile", mappedBy="userSent") |
||
| 403 | **/ |
||
| 404 | protected $dropBoxSentFiles; |
||
| 405 | |||
| 406 | /** |
||
| 407 | * @ORM\Column(type="array") |
||
| 408 | */ |
||
| 409 | //protected $roles; |
||
| 410 | |||
| 411 | /** |
||
| 412 | * @var boolean |
||
| 413 | * |
||
| 414 | * @ORM\Column(name="profile_completed", type="boolean", nullable=true) |
||
| 415 | */ |
||
| 416 | protected $profileCompleted; |
||
| 417 | |||
| 418 | /** |
||
| 419 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\JuryMembers", mappedBy="user") |
||
| 420 | **/ |
||
| 421 | //protected $jurySubscriptions; |
||
| 422 | |||
| 423 | /** |
||
| 424 | * @ORM\ManyToMany(targetEntity="Chamilo\UserBundle\Entity\Group") |
||
| 425 | * @ORM\JoinTable(name="fos_user_user_group", |
||
| 426 | * joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")}, |
||
| 427 | * inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")} |
||
| 428 | * ) |
||
| 429 | */ |
||
| 430 | protected $groups; |
||
| 431 | |||
| 432 | //private $isActive; |
||
| 433 | |||
| 434 | /** |
||
| 435 | * ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\CurriculumItemRelUser", mappedBy="user") |
||
| 436 | **/ |
||
| 437 | protected $curriculumItems; |
||
| 438 | |||
| 439 | /* |
||
| 440 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\AccessUrlRelUser", mappedBy="user") |
||
| 441 | * |
||
| 442 | */ |
||
| 443 | protected $portals; |
||
| 444 | |||
| 445 | /** |
||
| 446 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Session", mappedBy="generalCoach") |
||
| 447 | **/ |
||
| 448 | protected $sessionAsGeneralCoach; |
||
| 449 | |||
| 450 | /** |
||
| 451 | * @var ArrayCollection |
||
| 452 | * ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\UserFieldValues", mappedBy="user", orphanRemoval=true, cascade={"persist"}) |
||
| 453 | **/ |
||
| 454 | protected $extraFields; |
||
| 455 | |||
| 456 | /** |
||
| 457 | * ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\Resource\ResourceNode", mappedBy="creator") |
||
| 458 | **/ |
||
| 459 | protected $resourceNodes; |
||
| 460 | |||
| 461 | /** |
||
| 462 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SessionRelCourseRelUser", mappedBy="user", cascade={"persist"}) |
||
| 463 | **/ |
||
| 464 | protected $sessionCourseSubscriptions; |
||
| 465 | |||
| 466 | /** |
||
| 467 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SkillRelUser", mappedBy="user", cascade={"persist"}) |
||
| 468 | */ |
||
| 469 | protected $achievedSkills; |
||
| 470 | |||
| 471 | /** |
||
| 472 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SkillRelUserComment", mappedBy="feedbackGiver") |
||
| 473 | */ |
||
| 474 | protected $commentedUserSkills; |
||
| 475 | |||
| 476 | /** |
||
| 477 | * Constructor |
||
| 478 | */ |
||
| 479 | public function __construct() |
||
| 505 | |||
| 506 | /** |
||
| 507 | * @return string |
||
| 508 | */ |
||
| 509 | public function __toString() |
||
| 513 | |||
| 514 | /** |
||
| 515 | * Updates the id with the user_id |
||
| 516 | * @ORM\PostPersist() |
||
| 517 | */ |
||
| 518 | public function postPersist(LifecycleEventArgs $args) |
||
| 528 | |||
| 529 | /** |
||
| 530 | * @param int $userId |
||
| 531 | */ |
||
| 532 | public function setId($userId) |
||
| 536 | |||
| 537 | /** |
||
| 538 | * @param int $userId |
||
| 539 | */ |
||
| 540 | public function setUserId($userId) |
||
| 546 | |||
| 547 | /** |
||
| 548 | * @return int |
||
| 549 | */ |
||
| 550 | public function getId() |
||
| 554 | |||
| 555 | /** |
||
| 556 | * @return string |
||
| 557 | */ |
||
| 558 | public function getEncoderName() |
||
| 562 | |||
| 563 | /** |
||
| 564 | * @return ArrayCollection |
||
| 565 | */ |
||
| 566 | public function getDropBoxSentFiles() |
||
| 570 | |||
| 571 | /** |
||
| 572 | * @return ArrayCollection |
||
| 573 | */ |
||
| 574 | public function getDropBoxReceivedFiles() |
||
| 578 | |||
| 579 | /** |
||
| 580 | * @return ArrayCollection |
||
| 581 | */ |
||
| 582 | public function getCourses() |
||
| 586 | |||
| 587 | /** |
||
| 588 | * @return array |
||
| 589 | */ |
||
| 590 | public static function getPasswordConstraints() |
||
| 613 | |||
| 614 | /** |
||
| 615 | * @param ClassMetadata $metadata |
||
| 616 | */ |
||
| 617 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
||
| 642 | |||
| 643 | /** |
||
| 644 | * @inheritDoc |
||
| 645 | */ |
||
| 646 | public function isEqualTo(UserInterface $user) |
||
| 666 | |||
| 667 | /** |
||
| 668 | * @return ArrayCollection |
||
| 669 | */ |
||
| 670 | public function getPortals() |
||
| 674 | |||
| 675 | /** |
||
| 676 | * @param $portal |
||
| 677 | */ |
||
| 678 | public function setPortal($portal) |
||
| 682 | |||
| 683 | /** |
||
| 684 | * @return ArrayCollection |
||
| 685 | */ |
||
| 686 | public function getCurriculumItems() |
||
| 690 | |||
| 691 | /** |
||
| 692 | * @param $items |
||
| 693 | */ |
||
| 694 | public function setCurriculumItems($items) |
||
| 698 | |||
| 699 | /** |
||
| 700 | * @return bool |
||
| 701 | */ |
||
| 702 | public function getIsActive() |
||
| 706 | |||
| 707 | /** |
||
| 708 | * @return bool |
||
| 709 | */ |
||
| 710 | public function isActive() |
||
| 714 | |||
| 715 | /** |
||
| 716 | * @inheritDoc |
||
| 717 | */ |
||
| 718 | public function isEnabled() |
||
| 722 | |||
| 723 | /** |
||
| 724 | * |
||
| 725 | * @return ArrayCollection |
||
| 726 | */ |
||
| 727 | /*public function getRolesObj() |
||
| 728 | { |
||
| 729 | return $this->roles; |
||
| 730 | }*/ |
||
| 731 | |||
| 732 | /** |
||
| 733 | * Set salt |
||
| 734 | * |
||
| 735 | * @param string $salt |
||
| 736 | * |
||
| 737 | * @return User |
||
| 738 | */ |
||
| 739 | public function setSalt($salt) |
||
| 745 | |||
| 746 | /** |
||
| 747 | * Get salt |
||
| 748 | * |
||
| 749 | * @return string |
||
| 750 | */ |
||
| 751 | public function getSalt() |
||
| 755 | |||
| 756 | /** |
||
| 757 | * @return ArrayCollection |
||
| 758 | */ |
||
| 759 | public function getClasses() |
||
| 763 | |||
| 764 | /** |
||
| 765 | * |
||
| 766 | */ |
||
| 767 | public function getLps() |
||
| 782 | |||
| 783 | /** |
||
| 784 | * Return Complete Name with the Username |
||
| 785 | * |
||
| 786 | * @return string |
||
| 787 | */ |
||
| 788 | public function getCompleteNameWithUsername() |
||
| 792 | |||
| 793 | /** |
||
| 794 | * @todo don't use api_get_person_name |
||
| 795 | * @return string |
||
| 796 | */ |
||
| 797 | public function getCompleteName() |
||
| 801 | |||
| 802 | /** |
||
| 803 | * Returns the list of classes for the user |
||
| 804 | * @return string |
||
| 805 | */ |
||
| 806 | public function getCompleteNameWithClasses() |
||
| 819 | |||
| 820 | /** |
||
| 821 | * Get userId |
||
| 822 | * |
||
| 823 | * @return integer |
||
| 824 | */ |
||
| 825 | public function getUserId() |
||
| 829 | |||
| 830 | /** |
||
| 831 | * Set lastname |
||
| 832 | * |
||
| 833 | * @param string $lastname |
||
| 834 | * |
||
| 835 | * @return User |
||
| 836 | */ |
||
| 837 | public function setLastname($lastname) |
||
| 843 | |||
| 844 | /** |
||
| 845 | * Set firstname |
||
| 846 | * |
||
| 847 | * @param string $firstname |
||
| 848 | * |
||
| 849 | * @return User |
||
| 850 | */ |
||
| 851 | public function setFirstname($firstname) |
||
| 857 | |||
| 858 | /** |
||
| 859 | * Set password |
||
| 860 | * |
||
| 861 | * @param string $password |
||
| 862 | * @return User |
||
| 863 | */ |
||
| 864 | public function setPassword($password) |
||
| 870 | |||
| 871 | /** |
||
| 872 | * Get password |
||
| 873 | * |
||
| 874 | * @return string |
||
| 875 | */ |
||
| 876 | public function getPassword() |
||
| 880 | |||
| 881 | /** |
||
| 882 | * Set authSource |
||
| 883 | * |
||
| 884 | * @param string $authSource |
||
| 885 | * @return User |
||
| 886 | */ |
||
| 887 | public function setAuthSource($authSource) |
||
| 893 | |||
| 894 | /** |
||
| 895 | * Get authSource |
||
| 896 | * |
||
| 897 | * @return string |
||
| 898 | */ |
||
| 899 | public function getAuthSource() |
||
| 903 | |||
| 904 | /** |
||
| 905 | * Set email |
||
| 906 | * |
||
| 907 | * @param string $email |
||
| 908 | * @return User |
||
| 909 | */ |
||
| 910 | public function setEmail($email) |
||
| 916 | |||
| 917 | /** |
||
| 918 | * Get email |
||
| 919 | * |
||
| 920 | * @return string |
||
| 921 | */ |
||
| 922 | public function getEmail() |
||
| 926 | |||
| 927 | /** |
||
| 928 | * Set status |
||
| 929 | * |
||
| 930 | * @param int $status |
||
| 931 | * |
||
| 932 | * @return User |
||
| 933 | */ |
||
| 934 | public function setStatus($status) |
||
| 940 | |||
| 941 | /** |
||
| 942 | * Get status |
||
| 943 | * |
||
| 944 | * @return boolean |
||
| 945 | */ |
||
| 946 | public function getStatus() |
||
| 950 | |||
| 951 | /** |
||
| 952 | * Set officialCode |
||
| 953 | * |
||
| 954 | * @param string $officialCode |
||
| 955 | * @return User |
||
| 956 | */ |
||
| 957 | public function setOfficialCode($officialCode) |
||
| 963 | |||
| 964 | /** |
||
| 965 | * Get officialCode |
||
| 966 | * |
||
| 967 | * @return string |
||
| 968 | */ |
||
| 969 | public function getOfficialCode() |
||
| 973 | |||
| 974 | /** |
||
| 975 | * Set phone |
||
| 976 | * |
||
| 977 | * @param string $phone |
||
| 978 | * @return User |
||
| 979 | */ |
||
| 980 | public function setPhone($phone) |
||
| 986 | |||
| 987 | /** |
||
| 988 | * Get phone |
||
| 989 | * |
||
| 990 | * @return string |
||
| 991 | */ |
||
| 992 | public function getPhone() |
||
| 996 | |||
| 997 | /** |
||
| 998 | * Set address |
||
| 999 | * |
||
| 1000 | * @param string $address |
||
| 1001 | * @return User |
||
| 1002 | */ |
||
| 1003 | public function setAddress($address) |
||
| 1009 | |||
| 1010 | /** |
||
| 1011 | * Get address |
||
| 1012 | * |
||
| 1013 | * @return string |
||
| 1014 | */ |
||
| 1015 | public function getAddress() |
||
| 1019 | |||
| 1020 | /** |
||
| 1021 | * Set pictureUri |
||
| 1022 | * |
||
| 1023 | * @param string $pictureUri |
||
| 1024 | * @return User |
||
| 1025 | */ |
||
| 1026 | public function setPictureUri($pictureUri) |
||
| 1032 | |||
| 1033 | /** |
||
| 1034 | * Get pictureUri |
||
| 1035 | * |
||
| 1036 | * @return Media |
||
| 1037 | */ |
||
| 1038 | public function getPictureUri() |
||
| 1042 | |||
| 1043 | /** |
||
| 1044 | * Set creatorId |
||
| 1045 | * |
||
| 1046 | * @param integer $creatorId |
||
| 1047 | * @return User |
||
| 1048 | */ |
||
| 1049 | public function setCreatorId($creatorId) |
||
| 1055 | |||
| 1056 | /** |
||
| 1057 | * Get creatorId |
||
| 1058 | * |
||
| 1059 | * @return integer |
||
| 1060 | */ |
||
| 1061 | public function getCreatorId() |
||
| 1065 | |||
| 1066 | /** |
||
| 1067 | * Set competences |
||
| 1068 | * |
||
| 1069 | * @param string $competences |
||
| 1070 | * @return User |
||
| 1071 | */ |
||
| 1072 | public function setCompetences($competences) |
||
| 1078 | |||
| 1079 | /** |
||
| 1080 | * Get competences |
||
| 1081 | * |
||
| 1082 | * @return string |
||
| 1083 | */ |
||
| 1084 | public function getCompetences() |
||
| 1088 | |||
| 1089 | /** |
||
| 1090 | * Set diplomas |
||
| 1091 | * |
||
| 1092 | * @param string $diplomas |
||
| 1093 | * @return User |
||
| 1094 | */ |
||
| 1095 | public function setDiplomas($diplomas) |
||
| 1101 | |||
| 1102 | /** |
||
| 1103 | * Get diplomas |
||
| 1104 | * |
||
| 1105 | * @return string |
||
| 1106 | */ |
||
| 1107 | public function getDiplomas() |
||
| 1111 | |||
| 1112 | /** |
||
| 1113 | * Set openarea |
||
| 1114 | * |
||
| 1115 | * @param string $openarea |
||
| 1116 | * @return User |
||
| 1117 | */ |
||
| 1118 | public function setOpenarea($openarea) |
||
| 1124 | |||
| 1125 | /** |
||
| 1126 | * Get openarea |
||
| 1127 | * |
||
| 1128 | * @return string |
||
| 1129 | */ |
||
| 1130 | public function getOpenarea() |
||
| 1134 | |||
| 1135 | /** |
||
| 1136 | * Set teach |
||
| 1137 | * |
||
| 1138 | * @param string $teach |
||
| 1139 | * @return User |
||
| 1140 | */ |
||
| 1141 | public function setTeach($teach) |
||
| 1147 | |||
| 1148 | /** |
||
| 1149 | * Get teach |
||
| 1150 | * |
||
| 1151 | * @return string |
||
| 1152 | */ |
||
| 1153 | public function getTeach() |
||
| 1157 | |||
| 1158 | /** |
||
| 1159 | * Set productions |
||
| 1160 | * |
||
| 1161 | * @param string $productions |
||
| 1162 | * @return User |
||
| 1163 | */ |
||
| 1164 | public function setProductions($productions) |
||
| 1170 | |||
| 1171 | /** |
||
| 1172 | * Get productions |
||
| 1173 | * |
||
| 1174 | * @return string |
||
| 1175 | */ |
||
| 1176 | public function getProductions() |
||
| 1180 | |||
| 1181 | /** |
||
| 1182 | * Set language |
||
| 1183 | * |
||
| 1184 | * @param string $language |
||
| 1185 | * @return User |
||
| 1186 | */ |
||
| 1187 | public function setLanguage($language) |
||
| 1193 | |||
| 1194 | /** |
||
| 1195 | * Get language |
||
| 1196 | * |
||
| 1197 | * @return string |
||
| 1198 | */ |
||
| 1199 | public function getLanguage() |
||
| 1203 | |||
| 1204 | /** |
||
| 1205 | * Set registrationDate |
||
| 1206 | * |
||
| 1207 | * @param \DateTime $registrationDate |
||
| 1208 | * @return User |
||
| 1209 | */ |
||
| 1210 | public function setRegistrationDate($registrationDate) |
||
| 1216 | |||
| 1217 | /** |
||
| 1218 | * Get registrationDate |
||
| 1219 | * |
||
| 1220 | * @return \DateTime |
||
| 1221 | */ |
||
| 1222 | public function getRegistrationDate() |
||
| 1226 | |||
| 1227 | /** |
||
| 1228 | * Set expirationDate |
||
| 1229 | * |
||
| 1230 | * @param \DateTime $expirationDate |
||
| 1231 | * |
||
| 1232 | * @return User |
||
| 1233 | */ |
||
| 1234 | public function setExpirationDate($expirationDate) |
||
| 1240 | |||
| 1241 | /** |
||
| 1242 | * Get expirationDate |
||
| 1243 | * |
||
| 1244 | * @return \DateTime |
||
| 1245 | */ |
||
| 1246 | public function getExpirationDate() |
||
| 1250 | |||
| 1251 | /** |
||
| 1252 | * Set active |
||
| 1253 | * |
||
| 1254 | * @param boolean $active |
||
| 1255 | * @return User |
||
| 1256 | */ |
||
| 1257 | public function setActive($active) |
||
| 1263 | |||
| 1264 | /** |
||
| 1265 | * Get active |
||
| 1266 | * |
||
| 1267 | * @return boolean |
||
| 1268 | */ |
||
| 1269 | public function getActive() |
||
| 1273 | |||
| 1274 | /** |
||
| 1275 | * Set openid |
||
| 1276 | * |
||
| 1277 | * @param string $openid |
||
| 1278 | * @return User |
||
| 1279 | */ |
||
| 1280 | public function setOpenid($openid) |
||
| 1286 | |||
| 1287 | /** |
||
| 1288 | * Get openid |
||
| 1289 | * |
||
| 1290 | * @return string |
||
| 1291 | */ |
||
| 1292 | public function getOpenid() |
||
| 1296 | |||
| 1297 | /** |
||
| 1298 | * Set theme |
||
| 1299 | * |
||
| 1300 | * @param string $theme |
||
| 1301 | * @return User |
||
| 1302 | */ |
||
| 1303 | public function setTheme($theme) |
||
| 1309 | |||
| 1310 | /** |
||
| 1311 | * Get theme |
||
| 1312 | * |
||
| 1313 | * @return string |
||
| 1314 | */ |
||
| 1315 | public function getTheme() |
||
| 1319 | |||
| 1320 | /** |
||
| 1321 | * Set hrDeptId |
||
| 1322 | * |
||
| 1323 | * @param integer $hrDeptId |
||
| 1324 | * @return User |
||
| 1325 | */ |
||
| 1326 | public function setHrDeptId($hrDeptId) |
||
| 1332 | |||
| 1333 | /** |
||
| 1334 | * Get hrDeptId |
||
| 1335 | * |
||
| 1336 | * @return integer |
||
| 1337 | */ |
||
| 1338 | public function getHrDeptId() |
||
| 1342 | |||
| 1343 | /** |
||
| 1344 | * @return string |
||
| 1345 | */ |
||
| 1346 | public function getAvatar() |
||
| 1350 | |||
| 1351 | /** |
||
| 1352 | * @return string |
||
| 1353 | */ |
||
| 1354 | public function getAvatarOrAnonymous($size = 22) |
||
| 1364 | |||
| 1365 | /** |
||
| 1366 | * @return \DateTime |
||
| 1367 | */ |
||
| 1368 | public function getMemberSince() |
||
| 1372 | |||
| 1373 | /** |
||
| 1374 | * @return bool |
||
| 1375 | */ |
||
| 1376 | public function isOnline() |
||
| 1380 | |||
| 1381 | /** |
||
| 1382 | * @return int |
||
| 1383 | */ |
||
| 1384 | public function getIdentifier() |
||
| 1388 | |||
| 1389 | /** |
||
| 1390 | * If manually uploading a file (i.e. not using Symfony Form) ensure an instance |
||
| 1391 | * of 'UploadedFile' is injected into this setter to trigger the update. If this |
||
| 1392 | * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter |
||
| 1393 | * must be able to accept an instance of 'File' as the bundle will inject one here |
||
| 1394 | * during Doctrine hydration. |
||
| 1395 | * |
||
| 1396 | * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image |
||
| 1397 | */ |
||
| 1398 | public function setImageFile(File $image) |
||
| 1408 | |||
| 1409 | /** |
||
| 1410 | * @return File |
||
| 1411 | */ |
||
| 1412 | public function getImageFile() |
||
| 1416 | |||
| 1417 | /** |
||
| 1418 | * @param string $imageName |
||
| 1419 | */ |
||
| 1420 | public function setImageName($imageName) |
||
| 1424 | |||
| 1425 | /** |
||
| 1426 | * @return string |
||
| 1427 | */ |
||
| 1428 | public function getImageName() |
||
| 1432 | |||
| 1433 | /** |
||
| 1434 | * @return string |
||
| 1435 | */ |
||
| 1436 | public function getSlug() |
||
| 1440 | |||
| 1441 | /** |
||
| 1442 | * @param $slug |
||
| 1443 | * @return User |
||
| 1444 | */ |
||
| 1445 | public function setSlug($slug) |
||
| 1449 | |||
| 1450 | /** |
||
| 1451 | * Set lastLogin |
||
| 1452 | * |
||
| 1453 | * @param \DateTime $lastLogin |
||
| 1454 | * |
||
| 1455 | * @return User |
||
| 1456 | */ |
||
| 1457 | public function setLastLogin(\DateTime $lastLogin) |
||
| 1463 | |||
| 1464 | /** |
||
| 1465 | * Get lastLogin |
||
| 1466 | * |
||
| 1467 | * @return \DateTime |
||
| 1468 | */ |
||
| 1469 | public function getLastLogin() |
||
| 1473 | |||
| 1474 | /** |
||
| 1475 | * {@inheritdoc} |
||
| 1476 | */ |
||
| 1477 | public function getExtraFields() |
||
| 1481 | |||
| 1482 | /** |
||
| 1483 | * {@inheritdoc} |
||
| 1484 | */ |
||
| 1485 | public function setExtraFields($extraFields) |
||
| 1494 | |||
| 1495 | /** |
||
| 1496 | * {@inheritdoc} |
||
| 1497 | */ |
||
| 1498 | /*public function addExtraFields(ExtraFieldValues $extraFieldValue) |
||
| 1499 | { |
||
| 1500 | $extraFieldValue->setUser($this); |
||
| 1501 | $this->extraFields[] = $extraFieldValue; |
||
| 1502 | |||
| 1503 | return $this; |
||
| 1504 | }*/ |
||
| 1505 | |||
| 1506 | /** |
||
| 1507 | * {@inheritdoc} |
||
| 1508 | */ |
||
| 1509 | public function addExtraFields(ExtraFieldValues $extraFieldValue) |
||
| 1518 | |||
| 1519 | /** |
||
| 1520 | * {@inheritdoc} |
||
| 1521 | */ |
||
| 1522 | public function removeExtraField(ExtraFieldValues $attribute) |
||
| 1531 | |||
| 1532 | /** |
||
| 1533 | * {@inheritdoc} |
||
| 1534 | */ |
||
| 1535 | /*public function hasExtraField($attribute) |
||
| 1536 | { |
||
| 1537 | if (!$this->extraFields) { |
||
| 1538 | return false; |
||
| 1539 | } |
||
| 1540 | return $this->extraFields->contains($attribute); |
||
| 1541 | }*/ |
||
| 1542 | |||
| 1543 | /** |
||
| 1544 | * {@inheritdoc} |
||
| 1545 | */ |
||
| 1546 | public function hasExtraFieldByName($attributeName) |
||
| 1556 | |||
| 1557 | /** |
||
| 1558 | * {@inheritdoc} |
||
| 1559 | */ |
||
| 1560 | public function getExtraFieldByName($attributeName) |
||
| 1570 | |||
| 1571 | /** |
||
| 1572 | * Get sessionCourseSubscription |
||
| 1573 | * @return ArrayCollection |
||
| 1574 | */ |
||
| 1575 | public function getSessionCourseSubscriptions() |
||
| 1579 | |||
| 1580 | /** |
||
| 1581 | * @return string |
||
| 1582 | */ |
||
| 1583 | public function getConfirmationToken() |
||
| 1587 | |||
| 1588 | /** |
||
| 1589 | * @param string $confirmationToken |
||
| 1590 | * |
||
| 1591 | * @return User |
||
| 1592 | */ |
||
| 1593 | public function setConfirmationToken($confirmationToken) |
||
| 1599 | |||
| 1600 | /** |
||
| 1601 | * @return \DateTime |
||
| 1602 | */ |
||
| 1603 | public function getPasswordRequestedAt() |
||
| 1607 | |||
| 1608 | |||
| 1609 | /** |
||
| 1610 | * @param int $ttl |
||
| 1611 | * @return bool |
||
| 1612 | */ |
||
| 1613 | public function isPasswordRequestNonExpired($ttl) |
||
| 1618 | |||
| 1619 | public function getUsername() |
||
| 1623 | |||
| 1624 | /** |
||
| 1625 | * Returns the creation date. |
||
| 1626 | * |
||
| 1627 | * @return \DateTime|null |
||
| 1628 | */ |
||
| 1629 | public function getCreatedAt() |
||
| 1633 | |||
| 1634 | /** |
||
| 1635 | * Sets the last update date. |
||
| 1636 | * |
||
| 1637 | * @param \DateTime|null $updatedAt |
||
| 1638 | * |
||
| 1639 | * @return User |
||
| 1640 | */ |
||
| 1641 | public function setUpdatedAt(\DateTime $updatedAt = null) |
||
| 1647 | |||
| 1648 | /** |
||
| 1649 | * Returns the last update date. |
||
| 1650 | * |
||
| 1651 | * @return \DateTime|null |
||
| 1652 | */ |
||
| 1653 | public function getUpdatedAt() |
||
| 1657 | |||
| 1658 | /** |
||
| 1659 | * Returns the expiration date. |
||
| 1660 | * |
||
| 1661 | * @return \DateTime|null |
||
| 1662 | */ |
||
| 1663 | public function getExpiresAt() |
||
| 1667 | |||
| 1668 | /** |
||
| 1669 | * Returns the credentials expiration date. |
||
| 1670 | * |
||
| 1671 | * @return \DateTime |
||
| 1672 | */ |
||
| 1673 | public function getCredentialsExpireAt() |
||
| 1677 | |||
| 1678 | /** |
||
| 1679 | * Sets the credentials expiration date. |
||
| 1680 | * |
||
| 1681 | * @param \DateTime|null $date |
||
| 1682 | * |
||
| 1683 | * @return User |
||
| 1684 | */ |
||
| 1685 | public function setCredentialsExpireAt(\DateTime $date = null) |
||
| 1691 | |||
| 1692 | /** |
||
| 1693 | * Sets the user groups. |
||
| 1694 | * |
||
| 1695 | * @param array $groups |
||
| 1696 | * |
||
| 1697 | * @return User |
||
| 1698 | */ |
||
| 1699 | public function setGroups($groups) |
||
| 1707 | |||
| 1708 | /** |
||
| 1709 | * Sets the two-step verification code. |
||
| 1710 | * |
||
| 1711 | * @param string $twoStepVerificationCode |
||
| 1712 | * |
||
| 1713 | * @return User |
||
| 1714 | */ |
||
| 1715 | public function setTwoStepVerificationCode($twoStepVerificationCode) |
||
| 1721 | |||
| 1722 | /** |
||
| 1723 | * Returns the two-step verification code. |
||
| 1724 | * |
||
| 1725 | * @return string |
||
| 1726 | */ |
||
| 1727 | public function getTwoStepVerificationCode() |
||
| 1731 | |||
| 1732 | /** |
||
| 1733 | * @param string $biography |
||
| 1734 | * |
||
| 1735 | * @return User |
||
| 1736 | */ |
||
| 1737 | public function setBiography($biography) |
||
| 1743 | |||
| 1744 | /** |
||
| 1745 | * @return string |
||
| 1746 | */ |
||
| 1747 | public function getBiography() |
||
| 1751 | |||
| 1752 | /** |
||
| 1753 | * @param \DateTime $dateOfBirth |
||
| 1754 | * |
||
| 1755 | * @return User |
||
| 1756 | */ |
||
| 1757 | public function setDateOfBirth($dateOfBirth) |
||
| 1763 | |||
| 1764 | /** |
||
| 1765 | * @return \DateTime |
||
| 1766 | */ |
||
| 1767 | public function getDateOfBirth() |
||
| 1771 | |||
| 1772 | /** |
||
| 1773 | * @param string $facebookData |
||
| 1774 | * |
||
| 1775 | * @return User |
||
| 1776 | */ |
||
| 1777 | public function setFacebookData($facebookData) |
||
| 1783 | |||
| 1784 | /** |
||
| 1785 | * @return string |
||
| 1786 | */ |
||
| 1787 | public function getFacebookData() |
||
| 1791 | |||
| 1792 | /** |
||
| 1793 | * @param string $facebookName |
||
| 1794 | * |
||
| 1795 | * @return User |
||
| 1796 | */ |
||
| 1797 | public function setFacebookName($facebookName) |
||
| 1803 | |||
| 1804 | /** |
||
| 1805 | * @return string |
||
| 1806 | */ |
||
| 1807 | public function getFacebookName() |
||
| 1811 | |||
| 1812 | /** |
||
| 1813 | * @param string $facebookUid |
||
| 1814 | * |
||
| 1815 | * @return User |
||
| 1816 | */ |
||
| 1817 | public function setFacebookUid($facebookUid) |
||
| 1823 | |||
| 1824 | /** |
||
| 1825 | * @return string |
||
| 1826 | */ |
||
| 1827 | public function getFacebookUid() |
||
| 1831 | |||
| 1832 | /** |
||
| 1833 | * @return string |
||
| 1834 | */ |
||
| 1835 | public function getFirstname() |
||
| 1839 | |||
| 1840 | /** |
||
| 1841 | * @param string $gender |
||
| 1842 | * |
||
| 1843 | * @return User |
||
| 1844 | */ |
||
| 1845 | public function setGender($gender) |
||
| 1851 | |||
| 1852 | /** |
||
| 1853 | * @return string |
||
| 1854 | */ |
||
| 1855 | public function getGender() |
||
| 1859 | |||
| 1860 | /** |
||
| 1861 | * @param string $gplusData |
||
| 1862 | * |
||
| 1863 | * @return User |
||
| 1864 | */ |
||
| 1865 | public function setGplusData($gplusData) |
||
| 1871 | |||
| 1872 | /** |
||
| 1873 | * @return string |
||
| 1874 | */ |
||
| 1875 | public function getGplusData() |
||
| 1879 | |||
| 1880 | /** |
||
| 1881 | * @param string $gplusName |
||
| 1882 | * |
||
| 1883 | * @return User |
||
| 1884 | */ |
||
| 1885 | public function setGplusName($gplusName) |
||
| 1891 | |||
| 1892 | /** |
||
| 1893 | * @return string |
||
| 1894 | */ |
||
| 1895 | public function getGplusName() |
||
| 1899 | |||
| 1900 | /** |
||
| 1901 | * @param string $gplusUid |
||
| 1902 | * |
||
| 1903 | * @return User |
||
| 1904 | */ |
||
| 1905 | public function setGplusUid($gplusUid) |
||
| 1911 | |||
| 1912 | /** |
||
| 1913 | * @return string |
||
| 1914 | */ |
||
| 1915 | public function getGplusUid() |
||
| 1919 | |||
| 1920 | /** |
||
| 1921 | * @return string |
||
| 1922 | */ |
||
| 1923 | public function getLastname() |
||
| 1927 | |||
| 1928 | /** |
||
| 1929 | * @param string $locale |
||
| 1930 | * |
||
| 1931 | * @return User |
||
| 1932 | */ |
||
| 1933 | public function setLocale($locale) |
||
| 1939 | |||
| 1940 | /** |
||
| 1941 | * @return string |
||
| 1942 | */ |
||
| 1943 | public function getLocale() |
||
| 1947 | |||
| 1948 | /** |
||
| 1949 | * @param string $timezone |
||
| 1950 | * |
||
| 1951 | * @return User |
||
| 1952 | */ |
||
| 1953 | public function setTimezone($timezone) |
||
| 1959 | |||
| 1960 | /** |
||
| 1961 | * @return string |
||
| 1962 | */ |
||
| 1963 | public function getTimezone() |
||
| 1967 | |||
| 1968 | /** |
||
| 1969 | * @param string $twitterData |
||
| 1970 | * |
||
| 1971 | * @return User |
||
| 1972 | */ |
||
| 1973 | public function setTwitterData($twitterData) |
||
| 1979 | |||
| 1980 | /** |
||
| 1981 | * @return string |
||
| 1982 | */ |
||
| 1983 | public function getTwitterData() |
||
| 1987 | |||
| 1988 | /** |
||
| 1989 | * @param string $twitterName |
||
| 1990 | * |
||
| 1991 | * @return User |
||
| 1992 | */ |
||
| 1993 | public function setTwitterName($twitterName) |
||
| 1999 | |||
| 2000 | /** |
||
| 2001 | * @return string |
||
| 2002 | */ |
||
| 2003 | public function getTwitterName() |
||
| 2007 | |||
| 2008 | /** |
||
| 2009 | * @param string $twitterUid |
||
| 2010 | * |
||
| 2011 | * @return User |
||
| 2012 | */ |
||
| 2013 | public function setTwitterUid($twitterUid) |
||
| 2019 | |||
| 2020 | /** |
||
| 2021 | * @return string |
||
| 2022 | */ |
||
| 2023 | public function getTwitterUid() |
||
| 2027 | |||
| 2028 | /** |
||
| 2029 | * @param string $website |
||
| 2030 | * |
||
| 2031 | * @return User |
||
| 2032 | */ |
||
| 2033 | public function setWebsite($website) |
||
| 2039 | |||
| 2040 | /** |
||
| 2041 | * @return string |
||
| 2042 | */ |
||
| 2043 | public function getWebsite() |
||
| 2047 | |||
| 2048 | /** |
||
| 2049 | * @param string $token |
||
| 2050 | * |
||
| 2051 | * @return User |
||
| 2052 | */ |
||
| 2053 | public function setToken($token) |
||
| 2059 | |||
| 2060 | /** |
||
| 2061 | * @return string |
||
| 2062 | */ |
||
| 2063 | public function getToken() |
||
| 2067 | |||
| 2068 | /** |
||
| 2069 | * @return string |
||
| 2070 | */ |
||
| 2071 | public function getFullname() |
||
| 2075 | |||
| 2076 | /** |
||
| 2077 | * @return array |
||
| 2078 | */ |
||
| 2079 | public function getRealRoles() |
||
| 2083 | |||
| 2084 | /** |
||
| 2085 | * @param array $roles |
||
| 2086 | * |
||
| 2087 | * @return User |
||
| 2088 | */ |
||
| 2089 | public function setRealRoles(array $roles) |
||
| 2095 | |||
| 2096 | /** |
||
| 2097 | * Removes sensitive data from the user. |
||
| 2098 | */ |
||
| 2099 | public function eraseCredentials() |
||
| 2103 | |||
| 2104 | /** |
||
| 2105 | * @return string |
||
| 2106 | */ |
||
| 2107 | public function getUsernameCanonical() |
||
| 2111 | |||
| 2112 | /** |
||
| 2113 | * @return string |
||
| 2114 | */ |
||
| 2115 | public function getEmailCanonical() |
||
| 2119 | |||
| 2120 | /** |
||
| 2121 | * @return mixed |
||
| 2122 | */ |
||
| 2123 | public function getPlainPassword() |
||
| 2129 | |||
| 2130 | /** |
||
| 2131 | * Returns the user roles |
||
| 2132 | * |
||
| 2133 | * @return array The roles |
||
| 2134 | */ |
||
| 2135 | public function getRoles() |
||
| 2148 | |||
| 2149 | /** |
||
| 2150 | * Never use this to check if this user has access to anything! |
||
| 2151 | * |
||
| 2152 | * Use the SecurityContext, or an implementation of AccessDecisionManager |
||
| 2153 | * instead, e.g. |
||
| 2154 | * |
||
| 2155 | * $securityContext->isGranted('ROLE_USER'); |
||
| 2156 | * |
||
| 2157 | * @param string $role |
||
| 2158 | * |
||
| 2159 | * @return boolean |
||
| 2160 | */ |
||
| 2161 | public function hasRole($role) |
||
| 2165 | |||
| 2166 | public function isAccountNonExpired() |
||
| 2178 | |||
| 2179 | public function isAccountNonLocked() |
||
| 2183 | |||
| 2184 | public function isCredentialsNonExpired() |
||
| 2196 | |||
| 2197 | public function isCredentialsExpired() |
||
| 2201 | |||
| 2202 | public function isExpired() |
||
| 2206 | |||
| 2207 | public function isLocked() |
||
| 2211 | |||
| 2212 | public function isSuperAdmin() |
||
| 2216 | |||
| 2217 | public function isUser(UserInterface $user = null) |
||
| 2221 | |||
| 2222 | public function removeRole($role) |
||
| 2231 | |||
| 2232 | public function setUsername($username) |
||
| 2238 | |||
| 2239 | public function setUsernameCanonical($usernameCanonical) |
||
| 2245 | |||
| 2246 | /** |
||
| 2247 | * @param boolean $boolean |
||
| 2248 | * |
||
| 2249 | * @return User |
||
| 2250 | */ |
||
| 2251 | public function setCredentialsExpired($boolean) |
||
| 2257 | |||
| 2258 | public function setEmailCanonical($emailCanonical) |
||
| 2264 | |||
| 2265 | public function setEnabled($boolean) |
||
| 2271 | |||
| 2272 | /** |
||
| 2273 | * Sets this user to expired. |
||
| 2274 | * |
||
| 2275 | * @param Boolean $boolean |
||
| 2276 | * |
||
| 2277 | * @return User |
||
| 2278 | */ |
||
| 2279 | public function setExpired($boolean) |
||
| 2285 | |||
| 2286 | /** |
||
| 2287 | * @param \DateTime $date |
||
| 2288 | * |
||
| 2289 | * @return User |
||
| 2290 | */ |
||
| 2291 | public function setExpiresAt(\DateTime $date = null) |
||
| 2297 | |||
| 2298 | public function setSuperAdmin($boolean) |
||
| 2308 | |||
| 2309 | public function setPlainPassword($password) |
||
| 2315 | |||
| 2316 | public function setLocked($boolean) |
||
| 2322 | |||
| 2323 | public function setPasswordRequestedAt(\DateTime $date = null) |
||
| 2329 | |||
| 2330 | |||
| 2331 | public function setRoles(array $roles) |
||
| 2341 | |||
| 2342 | /** |
||
| 2343 | * Gets the groups granted to the user. |
||
| 2344 | * |
||
| 2345 | * @return Collection |
||
| 2346 | */ |
||
| 2347 | public function getGroups() |
||
| 2351 | |||
| 2352 | public function getGroupNames() |
||
| 2361 | |||
| 2362 | public function hasGroup($name) |
||
| 2366 | |||
| 2367 | public function addGroup(GroupInterface $group) |
||
| 2375 | |||
| 2376 | public function removeGroup(GroupInterface $group) |
||
| 2384 | |||
| 2385 | public function addRole($role) |
||
| 2398 | |||
| 2399 | /** |
||
| 2400 | * Serializes the user. |
||
| 2401 | * |
||
| 2402 | * The serialized data have to contain the fields used by the equals method and the username. |
||
| 2403 | * |
||
| 2404 | * @return string |
||
| 2405 | */ |
||
| 2406 | public function serialize() |
||
| 2420 | |||
| 2421 | /** |
||
| 2422 | * Unserializes the user. |
||
| 2423 | * |
||
| 2424 | * @param string $serialized |
||
| 2425 | */ |
||
| 2426 | public function unserialize($serialized) |
||
| 2445 | |||
| 2446 | /** |
||
| 2447 | * Get achievedSkills |
||
| 2448 | * @return ArrayCollection |
||
| 2449 | */ |
||
| 2450 | public function getAchievedSkills() |
||
| 2454 | |||
| 2455 | /** |
||
| 2456 | * Check if the user has the skill |
||
| 2457 | * @param Skill $skill The skill |
||
| 2458 | * @return boolean |
||
| 2459 | */ |
||
| 2460 | public function hasSkill(Skill $skill) |
||
| 2471 | |||
| 2472 | /** |
||
| 2473 | * @return bool |
||
| 2474 | */ |
||
| 2475 | public function isProfileCompleted() |
||
| 2479 | |||
| 2480 | /** |
||
| 2481 | * @param mixed $profileCompleted |
||
| 2482 | * @return User |
||
| 2483 | */ |
||
| 2484 | public function setProfileCompleted($profileCompleted) |
||
| 2490 | |||
| 2491 | |||
| 2492 | /** |
||
| 2493 | * Sets the AccessUrl for the current user in memory |
||
| 2494 | * @param AccessUrl $url |
||
| 2495 | * |
||
| 2496 | * @return $this |
||
| 2497 | */ |
||
| 2498 | View Code Duplication | public function setCurrentUrl(AccessUrl $url) |
|
| 2511 | |||
| 2512 | /** |
||
| 2513 | * @return AccessUrl |
||
| 2514 | */ |
||
| 2515 | public function getCurrentUrl() |
||
| 2519 | |||
| 2520 | /** |
||
| 2521 | * @return mixed |
||
| 2522 | */ |
||
| 2523 | public function getFacebookId() |
||
| 2527 | |||
| 2528 | /** |
||
| 2529 | * @param mixed $facebookId |
||
| 2530 | */ |
||
| 2531 | public function setFacebookId($facebookId) |
||
| 2535 | |||
| 2536 | /** |
||
| 2537 | * @return mixed |
||
| 2538 | */ |
||
| 2539 | public function getFacebookAccessToken() |
||
| 2543 | |||
| 2544 | /** |
||
| 2545 | * @param mixed $facebookAccessToken |
||
| 2546 | */ |
||
| 2547 | public function setFacebookAccessToken($facebookAccessToken) |
||
| 2551 | |||
| 2552 | /** |
||
| 2553 | * @return mixed |
||
| 2554 | */ |
||
| 2555 | public function getGoogleId() |
||
| 2559 | |||
| 2560 | /** |
||
| 2561 | * @param mixed $googleId |
||
| 2562 | */ |
||
| 2563 | public function setGoogleId($googleId) |
||
| 2567 | |||
| 2568 | /** |
||
| 2569 | * @return mixed |
||
| 2570 | */ |
||
| 2571 | public function getGoogleAccessToken() |
||
| 2575 | |||
| 2576 | /** |
||
| 2577 | * @param mixed $googleAccessToken |
||
| 2578 | */ |
||
| 2579 | public function setGoogleAccessToken($googleAccessToken) |
||
| 2583 | |||
| 2584 | /** |
||
| 2585 | * @return mixed |
||
| 2586 | */ |
||
| 2587 | public function getGithubId() |
||
| 2591 | |||
| 2592 | /** |
||
| 2593 | * @param mixed $githubId |
||
| 2594 | */ |
||
| 2595 | public function setGithubId($githubId) |
||
| 2599 | |||
| 2600 | /** |
||
| 2601 | * @return mixed |
||
| 2602 | */ |
||
| 2603 | public function getGithubAccessToken() |
||
| 2607 | |||
| 2608 | /** |
||
| 2609 | * @param mixed $githubAccessToken |
||
| 2610 | */ |
||
| 2611 | public function setGithubAccessToken($githubAccessToken) |
||
| 2615 | |||
| 2616 | |||
| 2617 | |||
| 2618 | } |
||
| 2619 |
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.