Apps authentication. (#913)
[openemr.git] / entities / User.php
blob8f65237212037e181eee7356d9df95a08868d954
1 <?php
2 /**
3 * User entity.
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Matthew Vita <matthewvita48@gmail.com>
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2017 Matthew Vita <matthewvita48@gmail.com>
10 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
14 namespace entities;
16 use Doctrine\ORM\Mapping\Entity;
17 use Doctrine\ORM\Mapping\Table;
18 use Doctrine\ORM\Mapping\Column;
19 use Doctrine\ORM\Mapping\Id;
20 use Doctrine\ORM\Mapping\Index;
21 use Doctrine\ORM\Mapping\OneToMany;
22 use Doctrine\ORM\Mapping\GeneratedValue;
24 /**
25 * @Table(name="users")
26 * @Entity(repositoryClass="repositories\UserRepository")
28 class User {
29 /**
30 * Default constructor.
32 public function __construct() {}
34 /**
35 * @Column(name="id", type="integer")
36 * @GeneratedValue(strategy="AUTO")
38 private $id;
40 /**
41 * @OneToMany(targetEntity="ONote", mappedBy="user")
43 private $oNotes;
45 /**
46 * @Id
47 * @Column(name="username", type="string")
49 private $username;
51 /**
52 * @Column(name="calendar", type="boolean")
54 private $calendar;
56 /**
57 * @Column(name="irnpool", type="string")
59 private $irnPool;
61 /**
62 * @Column(name="cpoe", type="boolean")
64 private $cpoe;
66 /**
67 * @Column(name="physician_type", type="string")
69 private $physicianType;
71 /**
72 * @Column(name="newcrop_user_role", type="string")
74 private $newCropUserRole;
76 /**
77 * @Column(name="state_license_number", type="string")
79 private $stateLicenseNumber;
81 /**
82 * @Column(name="default_warehouse", type="string")
84 private $defaultWarehouse;
86 /**
87 * @Column(name="pwd_history2", type="text")
89 private $pwdHistory2;
91 /**
92 * @Column(name="pwd_history1", type="text")
94 private $pwdHistory1;
96 /**
97 * @Column(name="pwd_expiration_date", type="string")
99 private $pwdExpirationDate;
102 * @Column(name="abook_type", type="string")
104 private $aBookType;
107 * @Column(name="password", type="text")
109 private $password;
112 * @Column(name="authorized", type="boolean")
114 private $authorized;
117 * @Column(name="info", type="text")
119 private $info;
122 * @Column(name="taxonomy", type="string")
124 private $taxonomy;
127 * @Column(name="cal_ui", type="boolean")
129 private $calUi;
132 * @Column(name="notes", type="text")
134 private $notes;
137 * @Column(name="phonecell", type="string")
139 private $phoneCell;
142 * @Column(name="phonew2", type="string")
144 private $phoneW2;
147 * @Column(name="phonew1", type="string")
149 private $phoneW1;
152 * @Column(name="fax", type="string")
154 private $fax;
157 * @Column(name="phone", type="string")
159 private $phone;
162 * @Column(name="zip2", type="string")
164 private $zip2;
167 * @Column(name="state2", type="string")
169 private $state2;
172 * @Column(name="city2", type="string")
174 private $city2;
177 * @Column(name="streetb2", type="string")
179 private $streetB2;
182 * @Column(name="street2", type="string")
184 private $street2;
187 * @Column(name="zip", type="string")
189 private $zip;
192 * @Column(name="state", type="string")
194 private $state;
197 * @Column(name="city", type="string")
199 private $city;
202 * @Column(name="streetb", type="string")
204 private $streetB;
207 * @Column(name="street", type="string")
209 private $street;
212 * @Column(name="valedictory", type="string")
214 private $valedictory;
217 * @Column(name="organization", type="string")
219 private $organization;
222 * @Column(name="assistant", type="string")
224 private $assistant;
227 * @Column(name="url", type="string")
229 private $url;
232 * @Column(name="email_direct", type="string")
234 private $emailDirect;
237 * @Column(name="email", type="string")
239 private $email;
242 * @Column(name="billname", type="string")
244 private $billName;
247 * @Column(name="specialty", type="string")
249 private $specialty;
252 * @Column(name="title", type="string")
254 private $title;
257 * @Column(name="npi", type="string")
259 private $npi;
262 * @Column(name="active", type="boolean")
264 private $active;
267 * @Column(name="see_auth", type="integer")
269 private $seeAuth;
272 * @Column(name="facility_id", type="integer")
274 private $facilityId;
277 * @Column(name="facility", type="string")
279 private $facility;
282 * @Column(name="upin", type="string")
284 private $upin;
287 * @Column(name="federalDrugId", type="string")
289 private $federalDrugId;
292 * @Column(name="federaltaxid", type="string")
294 private $federalTaxId;
297 * @Column(name="suffix", type="string")
299 private $suffix;
302 * @Column(name="lname", type="string")
304 private $lname;
307 * @Column(name="mname", type="string")
309 private $mname;
312 * @Column(name="fname", type="string")
314 private $fname;
317 * @Column(name="source", type="boolean")
319 private $source;
322 * @Column(name="main_menu_role", type="string")
324 private $mainMenuRole;
326 public function getId() {
327 return $this->id;
330 public function setId($value) {
331 $this->id = $value;
334 public function getUsername() {
335 return $this->username;
338 public function setUsername($value) {
339 $this->username = $value;
342 public function getPassword() {
343 return $this->password;
346 public function setPassword($value) {
347 $this->password = $value;
350 public function getAuthorized() {
351 return $this->authorized;
354 public function setAuthorized($value) {
355 $this->authorized = $value;
358 public function getInfo() {
359 return $this->info;
362 public function setInfo($value) {
363 $this->info = $value;
366 public function getSource() {
367 return $this->source;
370 public function setSource($value) {
371 $this->source = $value;
374 public function getFname() {
375 return $this->fname;
378 public function setFname($value) {
379 $this->fname = $value;
382 public function getMname() {
383 return $this->mname;
386 public function setMname($value) {
387 $this->mname = $value;
390 public function getLname() {
391 return $this->lname;
394 public function setLname($value) {
395 $this->lname = $value;
398 public function getSuffix() {
399 return $this->suffix;
402 public function setSuffix($value) {
403 $this->suffix = $value;
406 public function getFederalTaxId() {
407 return $this->federalTaxId;
410 public function setFederalTaxId($value) {
411 $this->federalTaxId = $value;
414 public function getFederalDrugId() {
415 return $this->federalDrugId;
418 public function setFederalDrugId($value) {
419 $this->federalDrugId = $value;
422 public function getUpin() {
423 return $this->upin;
426 public function setUpin($value) {
427 $this->upin = $value;
430 public function getFacility() {
431 return $this->facility;
434 public function setFacility($value) {
435 $this->facility = $value;
438 public function getFacilityId() {
439 return $this->facilityId;
442 public function setFacilityId($value) {
443 $this->facilityId = $value;
446 public function getSeeAuth() {
447 return $this->seeAuth;
450 public function setSeeAuth($value) {
451 $this->seeAuth = $value;
454 public function getActive() {
455 return $this->active;
458 public function setActive($value) {
459 $this->active = $value;
462 public function getNpi() {
463 return $this->npi;
466 public function setNpi($value) {
467 $this->npi = $value;
470 public function getTitle() {
471 return $this->title;
474 public function setTitle($value) {
475 $this->title = $value;
478 public function getSpecialty() {
479 return $this->specialty;
482 public function setSpecialty($value) {
483 $this->specialty = $value;
486 public function getBillName() {
487 return $this->billName;
490 public function setBillName($value) {
491 $this->billName = $value;
494 public function getEmail() {
495 return $this->email;
498 public function setEmail($value) {
499 $this->email = $value;
502 public function getEmailDirect() {
503 return $this->emailDirect;
506 public function setEmailDirect($value) {
507 $this->emailDirect = $value;
510 public function getUrl() {
511 return $this->url;
514 public function setUrl($value) {
515 $this->url = $value;
518 public function getAssistant() {
519 return $this->assistant;
522 public function setAssistant($value) {
523 $this->assistant = $value;
526 public function getOrganization() {
527 return $this->organization;
530 public function setOrganization($value) {
531 $this->organization = $value;
534 public function getValedictory() {
535 return $this->valedictory;
538 public function setValedictory($value) {
539 $this->valedictory = $value;
542 public function getStreet() {
543 return $this->street;
546 public function setStreet($value) {
547 $this->street = $value;
550 public function getStreetB() {
551 return $this->streetB;
554 public function setStreetB($value) {
555 $this->streetB = $value;
558 public function getCity() {
559 return $this->city;
562 public function setCity($value) {
563 $this->city = $value;
566 public function getState() {
567 return $this->state;
570 public function setState($value) {
571 $this->state = $value;
574 public function getZip() {
575 return $this->zip;
578 public function setZip($value) {
579 $this->zip = $value;
582 public function getStreet2() {
583 return $this->street2;
586 public function setStreet2($value) {
587 $this->street2 = $value;
590 public function getStreetB2() {
591 return $this->streetB2;
594 public function setStreetB2($value) {
595 $this->streetB2 = $value;
598 public function getCity2() {
599 return $this->city2;
602 public function setCity2($value) {
603 $this->city2 = $value;
606 public function getState2() {
607 return $this->state2;
610 public function setState2($value) {
611 $this->state2 = $value;
614 public function getZip2() {
615 return $this->zip2;
618 public function setZip2($value) {
619 $this->zip2 = $value;
622 public function getPhone() {
623 return $this->phone;
626 public function setPhone($value) {
627 $this->phone = $value;
630 public function getFax() {
631 return $this->fax;
634 public function setFax($value) {
635 $this->fax = $value;
638 public function getPhoneW1() {
639 return $this->phoneW1;
642 public function setPhoneW1($value) {
643 $this->phoneW1 = $value;
646 public function getPhoneW2() {
647 return $this->phoneW2;
650 public function setPhoneW2($value) {
651 $this->phoneW2 = $value;
654 public function getPhoneCell() {
655 return $this->phoneCell;
658 public function setPhoneCell($value) {
659 $this->phoneCell = $value;
662 public function getNotes() {
663 return $this->notes;
666 public function setNotes($value) {
667 $this->notes = $value;
670 public function getCalUi() {
671 return $this->calUi;
674 public function setCalUi($value) {
675 $this->calUi = $value;
678 public function getTaxonomy() {
679 return $this->taxonomy;
682 public function setTaxonomy($value) {
683 $this->taxonomy = $value;
686 public function getCalendar() {
687 return $this->calendar;
690 public function setCalendar($value) {
691 $this->calendar = $value;
694 public function getaBookType() {
695 return $this->aBookType;
698 public function setaBookType($value) {
699 $this->aBookType = $value;
702 public function getPwdExpirationDate() {
703 return $this->pwdExpirationDate;
706 public function setPwdExpirationDate($value) {
707 $this->pwdExpirationDate = $value;
710 public function getPwdHistory1() {
711 return $this->pwdHistory1;
714 public function setPwdHistory1($value) {
715 $this->pwdHistory1 = $value;
718 public function getPwdHistory2() {
719 return $this->pwdHistory2;
722 public function setPwdHistory2($value) {
723 $this->pwdHistory2 = $value;
726 public function getDefaultWarehouse() {
727 return $this->defaultWarehouse;
730 public function setDefaultWarehouse($value) {
731 $this->defaultWarehouse = $value;
734 public function getIrnPool() {
735 return $this->irnPool;
738 public function setIrnPool($value) {
739 $this->irnPool = $value;
742 public function getStateLicenseNumber() {
743 return $this->stateLicenseNumber;
746 public function setStateLicenseNumber($value) {
747 $this->stateLicenseNumber = $value;
750 public function getNewCropUserRole() {
751 return $this->newCropUserRole;
754 public function setNewCropUserRole($value) {
755 $this->newCropUserRole = $value;
758 public function getCpoe() {
759 return $this->cpoe;
762 public function setCpoe($value) {
763 $this->cpoe = $value;
766 public function getPhysicianType() {
767 return $this->physicianType;
770 public function setPhysicianType($value) {
771 $this->physicianType = $value;
774 public function getMainMenuRole() {
775 return $this->mainMenuRole;
778 public function setMainMenuRole($value) {
779 $this->mainMenuRole = $value;
783 * ToString of the entire object.
785 * @return object as string
787 public function __toString() {
788 return "id: '" . $this->getId() . "' " .
789 "username: '" . $this->getUsername() . "' " .
790 "password: '" . $this->getPassword() . "' " .
791 "authorized: '" . $this->getAuthorized() . "' " .
792 "info: '" . $this->getInfo() . "' " .
793 "source: '" . $this->getSource() . "' " .
794 "fname: '" . $this->getFname() . "' " .
795 "mname: '" . $this->getMname() . "' " .
796 "lname: '" . $this->getLname() . "' " .
797 "suffix: '" . $this->getSuffix() . "' " .
798 "federalTaxId: '" . $this->getFederalTaxId() . "' " .
799 "federalDrugId: '" . $this->getFederalDrugId() . "' " .
800 "upin: '" . $this->getUpin() . "' " .
801 "facility: '" . $this->getFacility() . "' " .
802 "facilityId: '" . $this->getFacilityId() . "' " .
803 "seeAuth: '" . $this->getSeeAuth() . "' " .
804 "active: '" . $this->getActive() . "' " .
805 "npi: '" . $this->getNpi() . "' " .
806 "title: '" . $this->getTitle() . "' " .
807 "specialty: '" . $this->getSpecialty() . "' " .
808 "billName: '" . $this->getBillName() . "' " .
809 "email: '" . $this->getEmail() . "' " .
810 "emailDirect: '" . $this->getEmailDirect() . "' " .
811 "url: '" . $this->getUrl() . "' " .
812 "assistant: '" . $this->getAssistant() . "' " .
813 "organization: '" . $this->getOrganization() . "' " .
814 "valedictory: '" . $this->getValedictory() . "' " .
815 "street: '" . $this->getStreet() . "' " .
816 "streetB: '" . $this->getStreetB() . "' " .
817 "city: '" . $this->getCity() . "' " .
818 "state: '" . $this->getState() . "' " .
819 "zip: '" . $this->getZip() . "' " .
820 "street2: '" . $this->getStreet2() . "' " .
821 "streetB2: '" . $this->getStreetB2() . "' " .
822 "city2: '" . $this->getCity2() . "' " .
823 "state2: '" . $this->getState2() . "' " .
824 "zip2: '" . $this->getZip2() . "' " .
825 "phone: '" . $this->getPhone() . "' " .
826 "fax: '" . $this->getFax() . "' " .
827 "phoneW1: '" . $this->getPhoneW1() . "' " .
828 "phoneW2: '" . $this->getPhoneW2() . "' " .
829 "phoneCell: '" . $this->getPhoneCell() . "' " .
830 "notes: '" . $this->getNotes() . "' " .
831 "calUi: '" . $this->getCalUi() . "' " .
832 "taxonomy: '" . $this->getTaxonomy() . "' " .
833 "calendar: '" . $this->getCalendar() . "' " .
834 "aBookType: '" . $this->getaBookType() . "' " .
835 "pwdExpirationDate: '" . $this->getPwdExpirationDate() . "' " .
836 "pwdHistory1: '" . $this->getPwdHistory1() . "' " .
837 "pwdHistory2: '" . $this->getPwdHistory2() . "' " .
838 "defaultWarehouse: '" . $this->getDefaultWarehouse() . "' " .
839 "irnPool: '" . $this->getIrnPool() . "' " .
840 "stateLicenseNumber: '" . $this->getStateLicenseNumber() . "' " .
841 "newCropUserRole: '" . $this->getNewCropUserRole() . "' " .
842 "cpoe: '" . $this->getCpoe() . "' " .
843 "physicianType: '" . $this->getPhysicianType() . "' " .
844 "mainMenuRole: '" . $this->getMainMenuRole() . "' ";
848 * ToSerializedObject of the entire object.
850 * @return object as serialized object.
852 public function toSerializedObject() {
853 return get_object_vars($this);