Complex classes like Person 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 Person, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 47 | class Person extends BaseUser implements PersonInterface, BackupCodeInterface |
||
| 48 | { |
||
| 49 | /** |
||
| 50 | * @ORM\Id |
||
| 51 | * @ORM\Column(type="integer") |
||
| 52 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 53 | * @JMS\Since("1.0") |
||
| 54 | */ |
||
| 55 | protected $id; |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @JMS\Expose |
||
| 59 | * @JMS\Groups({"first_name","full_name","public_profile","given_name","name"}) |
||
| 60 | * @ORM\Column(type="string", nullable=true) |
||
| 61 | * @Assert\NotBlank(message="Please enter your name.", groups={"Profile", "LoginCidadaoProfile"}) |
||
| 62 | * @Assert\Length( |
||
| 63 | * min=3, |
||
| 64 | * max="255", |
||
| 65 | * minMessage="The name is too short.", |
||
| 66 | * maxMessage="The name is too long.", |
||
| 67 | * groups={"Registration", "Profile", "LoginCidadaoProfile"} |
||
| 68 | * ) |
||
| 69 | * @JMS\Since("1.0") |
||
| 70 | */ |
||
| 71 | protected $firstName; |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @JMS\Expose |
||
| 75 | * @JMS\Groups({"last_name","full_name","family_name","middle_name","name"}) |
||
| 76 | * @ORM\Column(type="string", nullable=true) |
||
| 77 | * @Assert\NotBlank(message="Please enter your surname.", groups={"Profile", "LoginCidadaoProfile"}) |
||
| 78 | * @Assert\Length( |
||
| 79 | * min=1, |
||
| 80 | * max="255", |
||
| 81 | * minMessage="The surname is too short.", |
||
| 82 | * maxMessage="The surname is too long.", |
||
| 83 | * groups={"Registration", "Profile", "LoginCidadaoProfile"} |
||
| 84 | * ) |
||
| 85 | * @JMS\Since("1.0") |
||
| 86 | */ |
||
| 87 | protected $surname; |
||
| 88 | |||
| 89 | /** |
||
| 90 | * @JMS\Expose |
||
| 91 | * @JMS\Groups({"username","preferred_username"}) |
||
| 92 | * @Assert\NotBlank |
||
| 93 | * @Assert\Length( |
||
| 94 | * min="1", |
||
| 95 | * max="40", |
||
| 96 | * groups={"Registration", "Profile", "LoginCidadaoProfile"} |
||
| 97 | * ) |
||
| 98 | * @JMS\Since("1.0") |
||
| 99 | */ |
||
| 100 | protected $username; |
||
| 101 | |||
| 102 | /** |
||
| 103 | * @JMS\Exclude |
||
| 104 | * @PathWell( |
||
| 105 | * groups={"Registration", "ResetPassword", "ChangePassword", "LoginCidadaoRegistration"} |
||
| 106 | * ) |
||
| 107 | * @RollerworksPassword\PasswordRequirements( |
||
| 108 | * minLength=false, |
||
| 109 | * requireLetters=true, |
||
| 110 | * requireNumbers=true, |
||
| 111 | * missingLettersMessage="person.validation.password.missingLetters", |
||
| 112 | * missingNumbersMessage="person.validation.password.missingNumbers", |
||
| 113 | * groups={"Registration", "ResetPassword", "ChangePassword", "LoginCidadaoRegistration"} |
||
| 114 | * ) |
||
| 115 | * @Assert\Length( |
||
| 116 | * min=8, |
||
| 117 | * max=72, |
||
| 118 | * maxMessage="person.validation.password.length.max", |
||
| 119 | * minMessage="person.validation.password.length.min", |
||
| 120 | * groups={"Registration", "ResetPassword", "ChangePassword", "LoginCidadaoRegistration"} |
||
| 121 | * ) |
||
| 122 | * @Assert\NotBlank(message="person.validation.password.not_blank", groups={"Registration", "ResetPassword", "ChangePassword", "LoginCidadaoRegistration"}) |
||
| 123 | */ |
||
| 124 | protected $plainPassword; |
||
| 125 | |||
| 126 | /** |
||
| 127 | * @JMS\Expose |
||
| 128 | * @JMS\Groups({"cpf"}) |
||
| 129 | * @ORM\Column(type="string", nullable=true, unique=true) |
||
| 130 | * @LCAssert\CPF(groups={"Documents", "Dynamic", "LoginCidadaoRegistration"}) |
||
| 131 | * @JMS\Since("1.0") |
||
| 132 | */ |
||
| 133 | protected $cpf; |
||
| 134 | |||
| 135 | /** |
||
| 136 | * @JMS\Expose |
||
| 137 | * @JMS\Groups({"email"}) |
||
| 138 | * @JMS\Since("1.0") |
||
| 139 | * @Assert\Email(strict=true, groups={"Profile", "LoginCidadaoProfile", "Registration", "ResetPassword", "ChangePassword", "LoginCidadaoRegistration", "LoginCidadaoEmailForm"}) |
||
| 140 | * @Assert\NotBlank(message="person.validation.email.not_blank", groups={"Profile", "LoginCidadaoProfile", "Registration", "ResetPassword", "ChangePassword", "LoginCidadaoRegistration", "LoginCidadaoEmailForm"}) |
||
| 141 | */ |
||
| 142 | protected $email; |
||
| 143 | |||
| 144 | /** |
||
| 145 | * @JMS\Expose |
||
| 146 | * @JMS\Groups({"birthdate"}) |
||
| 147 | * @ORM\Column(type="date", nullable=true) |
||
| 148 | * @JMS\Since("1.0") |
||
| 149 | * @LCAssert\Age(max="150", groups={"Profile", "LoginCidadaoProfile", "Registration", "ResetPassword", "ChangePassword", "LoginCidadaoRegistration", "LoginCidadaoEmailForm"}) |
||
| 150 | */ |
||
| 151 | protected $birthdate; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @ORM\Column(name="email_expiration", type="datetime", nullable=true) |
||
| 155 | * @JMS\Since("1.0") |
||
| 156 | */ |
||
| 157 | protected $emailExpiration; |
||
| 158 | |||
| 159 | /** |
||
| 160 | * @JMS\Expose |
||
| 161 | * @JMS\Groups({"mobile","phone_number"}) |
||
| 162 | * @JMS\Type("libphonenumber\PhoneNumber") |
||
| 163 | * @ORM\Column(type="phone_number", nullable=true) |
||
| 164 | * @JMS\Since("1.0") |
||
| 165 | * @LCAssert\E164PhoneNumber( |
||
| 166 | * maxMessage="person.validation.mobile.length.max", |
||
| 167 | * groups={"Registration", "LoginCidadaoRegistration", "Dynamic", "Profile", "LoginCidadaoProfile"} |
||
| 168 | * ) |
||
| 169 | * @LCAssert\MobilePhoneNumber( |
||
| 170 | * missing9thDigit="person.validation.mobile.9thDigit", |
||
| 171 | * groups={"Registration", "LoginCidadaoRegistration", "Dynamic", "Profile", "LoginCidadaoProfile"} |
||
| 172 | * ) |
||
| 173 | * @AssertPhoneNumber( |
||
| 174 | * type="mobile", |
||
| 175 | * groups={"Registration", "LoginCidadaoRegistration", "Dynamic", "Profile", "LoginCidadaoProfile"} |
||
| 176 | * ) |
||
| 177 | */ |
||
| 178 | protected $mobile; |
||
| 179 | |||
| 180 | /** |
||
| 181 | * @ORM\Column(type="string", length=255, nullable=true) |
||
| 182 | * @var string |
||
| 183 | * @JMS\Since("1.0") |
||
| 184 | */ |
||
| 185 | protected $twitterPicture; |
||
| 186 | |||
| 187 | /** |
||
| 188 | * @JMS\Expose |
||
| 189 | * @JMS\Groups({"city"}) |
||
| 190 | * @ORM\ManyToOne(targetEntity="LoginCidadao\CoreBundle\Entity\City") |
||
| 191 | * @ORM\JoinColumn(name="city_id", referencedColumnName="id") |
||
| 192 | * @JMS\Since("1.0") |
||
| 193 | */ |
||
| 194 | protected $city; |
||
| 195 | |||
| 196 | /** |
||
| 197 | * @var string |
||
| 198 | * |
||
| 199 | * @ORM\Column(name="facebookId", type="string", length=255, nullable=true, unique=true) |
||
| 200 | * @JMS\Since("1.0") |
||
| 201 | */ |
||
| 202 | protected $facebookId; |
||
| 203 | |||
| 204 | /** |
||
| 205 | * @var string |
||
| 206 | * |
||
| 207 | * @ORM\Column(name="facebookUsername", type="string", length=255, nullable=true) |
||
| 208 | * @JMS\Since("1.0") |
||
| 209 | */ |
||
| 210 | protected $facebookUsername; |
||
| 211 | |||
| 212 | /** |
||
| 213 | * @var string |
||
| 214 | * |
||
| 215 | * @ORM\Column(name="facebookAccessToken", type="string", length=255, nullable=true) |
||
| 216 | * @JMS\Since("1.1") |
||
| 217 | */ |
||
| 218 | protected $facebookAccessToken; |
||
| 219 | |||
| 220 | /** |
||
| 221 | * @var string |
||
| 222 | * |
||
| 223 | * @ORM\Column(name="twitterId", type="string", length=255, nullable=true, unique=true) |
||
| 224 | * @JMS\Since("1.0") |
||
| 225 | */ |
||
| 226 | protected $twitterId; |
||
| 227 | |||
| 228 | /** |
||
| 229 | * @var string |
||
| 230 | * |
||
| 231 | * @ORM\Column(name="twitterUsername", type="string", length=255, nullable=true) |
||
| 232 | * @JMS\Since("1.0") |
||
| 233 | */ |
||
| 234 | protected $twitterUsername; |
||
| 235 | |||
| 236 | /** |
||
| 237 | * @var string |
||
| 238 | * |
||
| 239 | * @ORM\Column(name="twitterAccessToken", type="string", length=255, nullable=true) |
||
| 240 | * @JMS\Since("1.0") |
||
| 241 | */ |
||
| 242 | protected $twitterAccessToken; |
||
| 243 | |||
| 244 | /** |
||
| 245 | * @ORM\OneToMany(targetEntity="Authorization", mappedBy="person", cascade={"remove"}, orphanRemoval=true) |
||
| 246 | */ |
||
| 247 | protected $authorizations; |
||
| 248 | |||
| 249 | /** |
||
| 250 | * @ORM\Column(type="datetime", nullable=false) |
||
| 251 | * @var \DateTime |
||
| 252 | * @JMS\Since("1.0") |
||
| 253 | */ |
||
| 254 | protected $createdAt; |
||
| 255 | |||
| 256 | /** |
||
| 257 | * @ORM\Column(type="datetime", nullable=true) |
||
| 258 | * @var \DateTime |
||
| 259 | * @JMS\Since("1.0") |
||
| 260 | */ |
||
| 261 | protected $emailConfirmedAt; |
||
| 262 | |||
| 263 | /** |
||
| 264 | * @ORM\Column(type="string", length=255, nullable=true) |
||
| 265 | * @var string |
||
| 266 | * @JMS\Since("1.0") |
||
| 267 | */ |
||
| 268 | protected $previousValidEmail; |
||
| 269 | |||
| 270 | /** |
||
| 271 | * @ORM\ManyToMany(targetEntity="LoginCidadao\OAuthBundle\Entity\Client", mappedBy="owners") |
||
| 272 | */ |
||
| 273 | protected $clients; |
||
| 274 | |||
| 275 | /** |
||
| 276 | * @ORM\OneToMany(targetEntity="ClientSuggestion", mappedBy="person") |
||
| 277 | */ |
||
| 278 | protected $suggestions; |
||
| 279 | |||
| 280 | /** |
||
| 281 | * @JMS\Expose |
||
| 282 | * @JMS\Groups({"state"}) |
||
| 283 | * @ORM\ManyToOne(targetEntity="LoginCidadao\CoreBundle\Entity\State") |
||
| 284 | * @ORM\JoinColumn(name="state_id", referencedColumnName="id") |
||
| 285 | * @JMS\Since("1.0.2") |
||
| 286 | */ |
||
| 287 | protected $state; |
||
| 288 | |||
| 289 | /** |
||
| 290 | * @JMS\Expose |
||
| 291 | * @JMS\Groups({"country"}) |
||
| 292 | * @ORM\ManyToOne(targetEntity="LoginCidadao\CoreBundle\Entity\Country") |
||
| 293 | * @ORM\JoinColumn(name="country_id", referencedColumnName="id") |
||
| 294 | * @JMS\Since("1.0.2") |
||
| 295 | */ |
||
| 296 | protected $country; |
||
| 297 | |||
| 298 | /** |
||
| 299 | * @Assert\File( |
||
| 300 | * maxSize="2M", |
||
| 301 | * maxSizeMessage="The maxmimum allowed file size is 2MB.", |
||
| 302 | * mimeTypes={"image/png", "image/jpeg", "image/pjpeg"}, |
||
| 303 | * mimeTypesMessage="Only JPEG and PNG images are allowed." |
||
| 304 | * ) |
||
| 305 | * @Vich\UploadableField(mapping="user_image", fileNameProperty="imageName") |
||
| 306 | * @var File $image |
||
| 307 | * @JMS\Since("1.0.2") |
||
| 308 | */ |
||
| 309 | protected $image; |
||
| 310 | |||
| 311 | /** |
||
| 312 | * @ORM\Column(type="string", length=255, name="image_name", nullable=true) |
||
| 313 | * |
||
| 314 | * @var string $imageName |
||
| 315 | * @JMS\Since("1.0.2") |
||
| 316 | */ |
||
| 317 | protected $imageName; |
||
| 318 | |||
| 319 | /** |
||
| 320 | * @JMS\Expose |
||
| 321 | * @JMS\Groups({"public_profile","picture"}) |
||
| 322 | * @JMS\Since("1.0.2") |
||
| 323 | */ |
||
| 324 | protected $profilePictureUrl; |
||
| 325 | |||
| 326 | /** |
||
| 327 | * @ORM\Column(type="datetime", nullable=true) |
||
| 328 | * @JMS\Expose |
||
| 329 | * @JMS\Groups({"public_profile","updated_at"}) |
||
| 330 | * @var \DateTime $updatedAt |
||
| 331 | * @JMS\Since("1.0.2") |
||
| 332 | */ |
||
| 333 | protected $updatedAt; |
||
| 334 | |||
| 335 | /** |
||
| 336 | * @var string |
||
| 337 | * |
||
| 338 | * @ORM\Column(name="googleId", type="string", length=255, nullable=true, unique=true) |
||
| 339 | * @JMS\Since("1.0.3") |
||
| 340 | */ |
||
| 341 | protected $googleId; |
||
| 342 | |||
| 343 | /** |
||
| 344 | * @var string |
||
| 345 | * |
||
| 346 | * @ORM\Column(name="googleUsername", type="string", length=255, nullable=true) |
||
| 347 | * @JMS\Since("1.0.3") |
||
| 348 | */ |
||
| 349 | protected $googleUsername; |
||
| 350 | |||
| 351 | /** |
||
| 352 | * @var string |
||
| 353 | * |
||
| 354 | * @ORM\Column(name="googleAccessToken", type="string", length=255, nullable=true) |
||
| 355 | * @JMS\Since("1.0.3") |
||
| 356 | */ |
||
| 357 | protected $googleAccessToken; |
||
| 358 | |||
| 359 | /** |
||
| 360 | * @JMS\Expose |
||
| 361 | * @JMS\Groups({"id_cards"}) |
||
| 362 | * @ORM\OneToMany(targetEntity="LoginCidadao\CoreBundle\Entity\IdCard", mappedBy="person") |
||
| 363 | * @JMS\Since("1.0.3") |
||
| 364 | */ |
||
| 365 | protected $idCards; |
||
| 366 | |||
| 367 | /** |
||
| 368 | * @JMS\Expose |
||
| 369 | * @JMS\Groups({"public_profile"}) |
||
| 370 | * @var array |
||
| 371 | */ |
||
| 372 | protected $badges = array(); |
||
| 373 | |||
| 374 | /** |
||
| 375 | * @ORM\OneToMany(targetEntity="LoginCidadao\APIBundle\Entity\LogoutKey", mappedBy="person", cascade={"remove"}, orphanRemoval=true) |
||
| 376 | */ |
||
| 377 | protected $logoutKeys; |
||
| 378 | |||
| 379 | /** |
||
| 380 | * @JMS\Expose |
||
| 381 | * @JMS\Groups({"addresses","address"}) |
||
| 382 | * @ORM\OneToMany(targetEntity="LoginCidadao\CoreBundle\Entity\PersonAddress", mappedBy="person", cascade={"remove"}, orphanRemoval=true) |
||
| 383 | */ |
||
| 384 | protected $addresses; |
||
| 385 | |||
| 386 | /** |
||
| 387 | * @ORM\Column(name="google_authenticator_secret", type="string", nullable=true) |
||
| 388 | */ |
||
| 389 | protected $googleAuthenticatorSecret; |
||
| 390 | |||
| 391 | /** |
||
| 392 | * @JMS\Expose |
||
| 393 | * @JMS\Groups({"nationality"}) |
||
| 394 | * @ORM\ManyToOne(targetEntity="LoginCidadao\CoreBundle\Entity\Country") |
||
| 395 | * @ORM\JoinColumn(name="nationality_id", referencedColumnName="id") |
||
| 396 | * @JMS\Since("1.0.2") |
||
| 397 | */ |
||
| 398 | protected $nationality; |
||
| 399 | |||
| 400 | /** |
||
| 401 | * @JMS\Exclude |
||
| 402 | * @ORM\OneToMany(targetEntity="BackupCode", mappedBy="person", cascade={"remove"}, orphanRemoval=true) |
||
| 403 | */ |
||
| 404 | protected $backupCodes; |
||
| 405 | |||
| 406 | /** |
||
| 407 | * @JMS\Exclude |
||
| 408 | * @ORM\Column(name="password_encoder_name", type="string", length=255, nullable=true) |
||
| 409 | */ |
||
| 410 | protected $passwordEncoderName; |
||
| 411 | |||
| 412 | /** |
||
| 413 | * @JMS\Expose |
||
| 414 | * @JMS\Groups({"public_profile"}) |
||
| 415 | * @JMS\SerializedName("phone_number_verified") |
||
| 416 | * @var bool |
||
| 417 | */ |
||
| 418 | protected $phoneNumberVerified = false; |
||
| 419 | |||
| 420 | public function __construct() |
||
| 429 | |||
| 430 | public function getEmail() |
||
| 434 | |||
| 435 | public function setEmail($email) |
||
| 441 | |||
| 442 | public function getFirstName() |
||
| 446 | |||
| 447 | public function setFirstName($firstName) |
||
| 453 | |||
| 454 | public function getSurname() |
||
| 458 | |||
| 459 | public function setSurname($suname) |
||
| 465 | |||
| 466 | public function getBirthdate() |
||
| 470 | |||
| 471 | public function setBirthdate($birthdate) |
||
| 477 | |||
| 478 | public function getMobile() |
||
| 482 | |||
| 483 | public function setMobile($mobile) |
||
| 498 | |||
| 499 | public function addAuthorization(Authorization $authorization) |
||
| 506 | |||
| 507 | public function removeAuthorization(Authorization $authorization) |
||
| 515 | |||
| 516 | /** |
||
| 517 | * @return Authorization[] |
||
| 518 | */ |
||
| 519 | public function getAuthorizations($uidToIgnore = null) |
||
| 532 | |||
| 533 | /** |
||
| 534 | * Checks if a given Client can access this Person's specified scope. |
||
| 535 | * @param \LoginCidadao\OAuthBundle\Entity\Client $client |
||
| 536 | * @param mixed $scope can be a single scope or an array with several. |
||
| 537 | * @return boolean |
||
| 538 | */ |
||
| 539 | public function isAuthorizedClient(Client $client, $scope) |
||
| 551 | |||
| 552 | /** |
||
| 553 | * @param Client $client |
||
| 554 | * @return array |
||
| 555 | */ |
||
| 556 | public function getClientScope(Client $client) |
||
| 568 | |||
| 569 | /** |
||
| 570 | * Checks if this Person has any authorization for a given Client. |
||
| 571 | * WARNING: Note that it does NOT validate scope! |
||
| 572 | * @param \LoginCidadao\OAuthBundle\Entity\Client | integer $client |
||
| 573 | */ |
||
| 574 | public function hasAuthorization($client) |
||
| 593 | |||
| 594 | public function setFacebookId($facebookId) |
||
| 600 | |||
| 601 | public function getFacebookId() |
||
| 605 | |||
| 606 | public function setTwitterId($twitterId) |
||
| 612 | |||
| 613 | public function getTwitterId() |
||
| 617 | |||
| 618 | public function setTwitterUsername($twitterUsername) |
||
| 624 | |||
| 625 | public function getTwitterUsername() |
||
| 629 | |||
| 630 | public function setTwitterAccessToken($twitterAccessToken) |
||
| 636 | |||
| 637 | public function getTwitterAccessToken() |
||
| 641 | |||
| 642 | public function serialize() |
||
| 646 | |||
| 647 | public function unserialize($data) |
||
| 652 | |||
| 653 | /** |
||
| 654 | * Get the full name of the user (first + last name) |
||
| 655 | * @JMS\Groups({"full_name", "name"}) |
||
| 656 | * @JMS\VirtualProperty |
||
| 657 | * @JMS\SerializedName("full_name") |
||
| 658 | * @return string |
||
| 659 | */ |
||
| 660 | public function getFullName() |
||
| 676 | |||
| 677 | /** |
||
| 678 | * Get the full name of the user (first + last name) |
||
| 679 | * @JMS\Groups({"full_name", "name"}) |
||
| 680 | * @JMS\VirtualProperty |
||
| 681 | * @JMS\SerializedName("name") |
||
| 682 | * @return string |
||
| 683 | */ |
||
| 684 | public function getOIDCName() |
||
| 688 | |||
| 689 | /** |
||
| 690 | * @JMS\Groups({"badges", "public_profile"}) |
||
| 691 | * @JMS\VirtualProperty |
||
| 692 | * @JMS\SerializedName("deprecated_badges") |
||
| 693 | * @return array |
||
| 694 | */ |
||
| 695 | public function getDataValid() |
||
| 702 | |||
| 703 | public function setCpf($cpf) |
||
| 715 | |||
| 716 | public function getCpf() |
||
| 720 | |||
| 721 | /** |
||
| 722 | * @param \LoginCidadao\CoreBundle\Entity\City $city |
||
| 723 | * @return City |
||
| 724 | */ |
||
| 725 | public function setCity(\LoginCidadao\CoreBundle\Entity\City $city = null) |
||
| 731 | |||
| 732 | /** |
||
| 733 | * @return \LoginCidadao\CoreBundle\Entity\City |
||
| 734 | */ |
||
| 735 | public function getCity() |
||
| 739 | |||
| 740 | public function setCreatedAt(\DateTime $createdAt) |
||
| 746 | |||
| 747 | public function getCreatedAt() |
||
| 751 | |||
| 752 | /** |
||
| 753 | * @ORM\PrePersist |
||
| 754 | */ |
||
| 755 | public function setCreatedAtValue() |
||
| 764 | |||
| 765 | public function setEmailConfirmedAt(\DateTime $emailConfirmedAt = null) |
||
| 771 | |||
| 772 | public function getEmailConfirmedAt() |
||
| 776 | |||
| 777 | public function getSocialNetworksPicture() |
||
| 785 | |||
| 786 | public function getClients() |
||
| 790 | |||
| 791 | public function setClients($var) |
||
| 795 | |||
| 796 | public function setEmailExpiration($emailExpiration) |
||
| 802 | |||
| 803 | public function getEmailExpiration() |
||
| 807 | |||
| 808 | public function setFacebookUsername($facebookUsername) |
||
| 814 | |||
| 815 | public function getFacebookUsername() |
||
| 819 | |||
| 820 | public function getFacebookAccessToken() |
||
| 824 | |||
| 825 | public function setFacebookAccessToken($facebookAccessToken) |
||
| 831 | |||
| 832 | public function setPreviousValidEmail($previousValidEmail) |
||
| 838 | |||
| 839 | public function getPreviousValidEmail() |
||
| 843 | |||
| 844 | public function hasPassword() |
||
| 850 | |||
| 851 | public function setState(State $state = null) |
||
| 857 | |||
| 858 | public function getState() |
||
| 862 | |||
| 863 | /** |
||
| 864 | * If manually uploading a file (i.e. not using Symfony Form) ensure an instance |
||
| 865 | * of 'UploadedFile' is injected into this setter to trigger the update. If this |
||
| 866 | * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter |
||
| 867 | * must be able to accept an instance of 'File' as the bundle will inject one here |
||
| 868 | * during Doctrine hydration. |
||
| 869 | * |
||
| 870 | * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image |
||
| 871 | */ |
||
| 872 | public function setImage($image) |
||
| 880 | |||
| 881 | /** |
||
| 882 | * @return File |
||
| 883 | */ |
||
| 884 | public function getImage() |
||
| 888 | |||
| 889 | /** |
||
| 890 | * @param string $imageName |
||
| 891 | */ |
||
| 892 | public function setImageName($imageName) |
||
| 896 | |||
| 897 | /** |
||
| 898 | * @return string |
||
| 899 | */ |
||
| 900 | public function getImageName() |
||
| 904 | |||
| 905 | public function setProfilePictureUrl($profilePictureUrl) |
||
| 911 | |||
| 912 | public function getProfilePictureUrl() |
||
| 916 | |||
| 917 | /** |
||
| 918 | * @JMS\Groups({"public_profile"}) |
||
| 919 | * @JMS\VirtualProperty |
||
| 920 | * @JMS\SerializedName("age_range") |
||
| 921 | * @JMS\Type("array") |
||
| 922 | * @return array |
||
| 923 | */ |
||
| 924 | public function getAgeRange() |
||
| 950 | |||
| 951 | public function hasLocalProfilePicture() |
||
| 955 | |||
| 956 | public function getSuggestions() |
||
| 960 | |||
| 961 | public function setSuggestions($suggestions) |
||
| 967 | |||
| 968 | public function prepareAPISerialize( |
||
| 995 | |||
| 996 | public function isClientAuthorized($app_id) |
||
| 1006 | |||
| 1007 | /** |
||
| 1008 | * @ORM\PreUpdate |
||
| 1009 | */ |
||
| 1010 | public function setUpdatedAt($updatedAt = null) |
||
| 1020 | |||
| 1021 | public function getUpdatedAt() |
||
| 1025 | |||
| 1026 | public function setGoogleId($var) |
||
| 1032 | |||
| 1033 | public function getGoogleId() |
||
| 1037 | |||
| 1038 | public function setGoogleUsername($var) |
||
| 1044 | |||
| 1045 | public function getGoogleUsername() |
||
| 1049 | |||
| 1050 | public function setGoogleAccessToken($var) |
||
| 1056 | |||
| 1057 | public function getGoogleAccessToken() |
||
| 1061 | |||
| 1062 | public function setCountry(Country $country = null) |
||
| 1068 | |||
| 1069 | public function getCountry() |
||
| 1073 | |||
| 1074 | public function setComplement($var) |
||
| 1080 | |||
| 1081 | public function getComplement() |
||
| 1085 | |||
| 1086 | public function getIdCards() |
||
| 1090 | |||
| 1091 | public function getBadges() |
||
| 1095 | |||
| 1096 | public function mergeBadges(array $badges) |
||
| 1102 | |||
| 1103 | public function getFullNameOrUsername() |
||
| 1111 | |||
| 1112 | public function getLogoutKeys() |
||
| 1116 | |||
| 1117 | /** |
||
| 1118 | * @return ArrayCollection |
||
| 1119 | */ |
||
| 1120 | public function getAddresses() |
||
| 1124 | |||
| 1125 | public function setLogoutKeys($logoutKeys) |
||
| 1131 | |||
| 1132 | public function setAddresses($addresses) |
||
| 1138 | |||
| 1139 | /** |
||
| 1140 | * Checks whether 2FA is enabled. |
||
| 1141 | * |
||
| 1142 | * @return boolean |
||
| 1143 | */ |
||
| 1144 | public function isTwoFactorAuthenticationEnabled() |
||
| 1148 | |||
| 1149 | public function getGoogleAuthenticatorSecret() |
||
| 1153 | |||
| 1154 | public function setGoogleAuthenticatorSecret($googleAuthenticatorSecret) |
||
| 1160 | |||
| 1161 | public function getBackupCodes() |
||
| 1165 | |||
| 1166 | public function setBackupCodes(ArrayCollection $backupCodes) |
||
| 1172 | |||
| 1173 | public function invalidateBackupCode($code) |
||
| 1180 | |||
| 1181 | public function isBackupCode($code) |
||
| 1187 | |||
| 1188 | /** |
||
| 1189 | * @param string $code |
||
| 1190 | * @return BackupCode |
||
| 1191 | */ |
||
| 1192 | private function findBackupCode($code) |
||
| 1203 | |||
| 1204 | public function setNationality($var) |
||
| 1210 | |||
| 1211 | public function getNationality() |
||
| 1215 | |||
| 1216 | public function getPlaceOfBirth() |
||
| 1223 | |||
| 1224 | public function setPlaceOfBirth(LocationSelectData $location) |
||
| 1228 | |||
| 1229 | /** |
||
| 1230 | * @JMS\Groups({"public_profile"}) |
||
| 1231 | * @JMS\VirtualProperty |
||
| 1232 | * @JMS\SerializedName("given_name") |
||
| 1233 | */ |
||
| 1234 | public function getGivenName() |
||
| 1238 | |||
| 1239 | /** |
||
| 1240 | * @JMS\Groups({"full_name","name"}) |
||
| 1241 | * @JMS\VirtualProperty |
||
| 1242 | * @JMS\SerializedName("family_name") |
||
| 1243 | */ |
||
| 1244 | public function getFamilyName() |
||
| 1248 | |||
| 1249 | /** |
||
| 1250 | * @JMS\Groups({"mobile", "phone_number"}) |
||
| 1251 | * @JMS\VirtualProperty |
||
| 1252 | * @JMS\SerializedName("phone_number") |
||
| 1253 | */ |
||
| 1254 | public function getPhoneNumber() |
||
| 1258 | |||
| 1259 | /** |
||
| 1260 | * @param bool $verified |
||
| 1261 | * @return $this |
||
| 1262 | */ |
||
| 1263 | public function setPhoneNumberVerified($verified = false) |
||
| 1269 | |||
| 1270 | /** |
||
| 1271 | * @return bool |
||
| 1272 | */ |
||
| 1273 | public function getPhoneNumberVerified() |
||
| 1277 | |||
| 1278 | public function getPasswordEncoderName() |
||
| 1282 | |||
| 1283 | public function setPasswordEncoderName($passwordEncoderName) |
||
| 1289 | |||
| 1290 | public function getEncoderName() |
||
| 1301 | |||
| 1302 | public function getLongDisplayName() |
||
| 1310 | |||
| 1311 | public function getShortDisplayName() |
||
| 1319 | } |
||
| 1320 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.