src/Entity/User.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Security\Core\User\UserInterface;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use App\Entity\Company;
  7. use App\Entity\Partner;
  8. /**
  9.  * User
  10.  * @ORM\Table(name="user", indexes={@ORM\Index(name="user_company_fk_1", columns={"us_company_id"})})
  11.  * @ORM\Entity(repositoryClass="App\Repository\UserRepository")
  12.  * @ORM\HasLifecycleCallbacks
  13.  */
  14. class User implements UserInterface, \Serializable {
  15.     const STATUS_ACTIVE 1;
  16.     const STATUS_INACTIVE 2;
  17.     const IS_NOT_DELETE 0;
  18.     const IS_DELETE 1;
  19.     /* full actuacion */
  20.     const USER_SUPER_ADMIN 1;
  21.     /* full actuacion */
  22.     const USER_ADMINISTRATOR 2;
  23.     /* puede crear usuarios */
  24.     const USER_LICENSE_MANAGER 3;
  25.     /* ver reportes y listas */
  26.     const USER_REPORT_VIEWER 4;
  27.     /* usuario gestor de datos de BDs */
  28.     const USER_ADMIN_DATABASES 5;
  29.     /* usuario gestor de soportes */
  30.     const USER_TICKET_SUPPORT 6;
  31.     /* usuario supervisor de agentes */
  32.     const USER_AGENT_MANAGER 7;
  33.     /* usuario agente */
  34.     const USER_AGENT 8;
  35.     /* usuario reseller */
  36.     const USER_RESELLER 9;
  37.     /* usuario subreseller */
  38.     const USER_SUB_RESELLER 10;
  39.     /* usuario subsubreseller */
  40.     const USER_SUB_SUB_RESELLER 11;
  41.     /* usuario de soporte interno  */
  42.     const USER_INTERNAL_SUPPORT 12;
  43.     const LUNCH_TIME_ACTIVE 1;
  44.     const LUNCH_TIME_INACTIVE 0;
  45.     /**
  46.      * @var integer
  47.      * @ORM\Column(name="us_id", type="integer")
  48.      * @ORM\Id
  49.      * @ORM\GeneratedValue(strategy="IDENTITY")
  50.      */
  51.     private $id;
  52.     /**
  53.      * @var integer
  54.      * @ORM\Column(name="us_type", type="integer", options={"default":8})
  55.      */
  56.     protected $usType 8;
  57.     /**
  58.      * @var string
  59.      * @ORM\Column(name="us_name", type="string", length=50, nullable=true)
  60.      */
  61.     private $usName;
  62.     /**
  63.      * @var string
  64.      * @ORM\Column(name="us_last_name", type="string", length=50, nullable=true)
  65.      */
  66.     private $usLastName;
  67.     /**
  68.      * @var string
  69.      * @ORM\Column(name="us_email", type="string", length=50, nullable=true)
  70.      */
  71.     private $usEmail;
  72.     /**
  73.      * @var string
  74.      * @Assert\NotBlank()
  75.      * @ORM\Column(name="us_phone_number", type="string", length=50, nullable=true)
  76.      */
  77.     private $usPhoneNumber;
  78.     /**
  79.      * @var string
  80.      * @ORM\Column(name="us_phone_prefix", type="string", length=5, nullable=true, options={"default":"+1"})
  81.      */
  82.     private $usPhonePrefix '+1';
  83.     /**
  84.      * @var \DateTime
  85.      * @ORM\Column(name="us_date_created", type="date", nullable=true)
  86.      */
  87.     private $usDateCreated;
  88.     /**
  89.      * @var integer
  90.      * @ORM\Column(name="us_status", type="smallint", nullable=true)
  91.      */
  92.     private $usStatus;
  93.     /**
  94.      * @var \App\Entity\User
  95.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  96.      * @ORM\JoinColumns({
  97.      *   @ORM\JoinColumn(name="us_parent_id", referencedColumnName="us_id", onDelete="CASCADE")
  98.      * })
  99.      */
  100.     private $usUserParent;
  101.     /**
  102.      * @var \App\Entity\Company
  103.      * @ORM\ManyToOne(targetEntity="App\Entity\Company")
  104.      * @ORM\JoinColumns({
  105.      *   @ORM\JoinColumn(name="us_company_id", referencedColumnName="co_id", onDelete="CASCADE")
  106.      * })
  107.      */
  108.     private $usCompany;
  109.     /**
  110.      * @var string
  111.      * @ORM\Column(name="us_token", type="string", unique=true)
  112.      */
  113.     private $username;
  114.     /**
  115.      * @var string
  116.      * @ORM\Column(name="work_time", type="json", nullable=true)
  117.      */
  118.     private $worktime;
  119.     /**
  120.      * @var string
  121.      * @ORM\Column(name="us_validatephone", type="boolean", nullable=false)
  122.      */
  123.     private $validatePhone false;
  124.     /**
  125.      * @var string
  126.      * @ORM\Column(name="us_is_subagent", type="boolean", nullable=false, options={"default":false})
  127.      */
  128.     private $isSubagent false;
  129.     /**
  130.      * @var string
  131.      * @ORM\Column(name="us_is_super_agent_manager", type="boolean", nullable=false, options={"default":false})
  132.      */
  133.     private $isSuperAgentManager false;
  134.     /**
  135.      * @var string
  136.      * @ORM\Column(name="us_password", type="string", length=255)
  137.      */
  138.     private $password;
  139.     /**
  140.      * @var string
  141.      * @ORM\Column(name="us_credentials", type="string", length=255, nullable=true)
  142.      */
  143.     private $credentials;
  144.     /**
  145.      * @var string
  146.      * @ORM\Column(name="us_salt", type="string", length=255, nullable=true)
  147.      */
  148.     private $salt;
  149.     /**
  150.      * @var string
  151.      * @ORM\Column(name="us_deleted", type="boolean", nullable=false)
  152.      */
  153.     private $deleted;
  154.     /**
  155.      * @var boolean
  156.      * @ORM\Column(name="us_is_omt", type="boolean", nullable=false, options={"default":false})
  157.      */
  158.     private $isOMTUser false;
  159.     /**
  160.      * @var string
  161.      * @ORM\Column(name="us_second_pass", type="text", nullable=true)
  162.      */
  163.     private $secondPass;
  164.     /**
  165.      * @var Partner
  166.      * @ORM\ManyToOne(targetEntity="App\Entity\Partner")
  167.      * @ORM\JoinColumns({
  168.      *   @ORM\JoinColumn(name="us_partner_identify", referencedColumnName="p_id", nullable=true, onDelete="CASCADE")
  169.      * })
  170.      */
  171.     private $partner;
  172.     /**
  173.      * @var \App\Entity\Country
  174.      * @ORM\ManyToOne(targetEntity="App\Entity\Country")
  175.      * @ORM\JoinColumns({
  176.      *   @ORM\JoinColumn(name="us_country", referencedColumnName="co_id")
  177.      * })
  178.      */
  179.     private $country;
  180.     /**
  181.      * @var \App\Entity\State
  182.      * @ORM\ManyToOne(targetEntity="App\Entity\State")
  183.      * @ORM\JoinColumns({
  184.      *   @ORM\JoinColumn(name="us_state", referencedColumnName="st_id", nullable=true)
  185.      * })
  186.      */
  187.     private $state;
  188.     /**
  189.      * @var \App\Entity\Timezone
  190.      * @ORM\ManyToOne(targetEntity="App\Entity\Timezone")
  191.      * @ORM\JoinColumns({
  192.      *   @ORM\JoinColumn(name="us_time_zone", referencedColumnName="tm_id", nullable=true)
  193.      * })
  194.      */
  195.     private $timeZone;
  196.     /**
  197.      * @var string
  198.      * @ORM\Column(name="us_default_calendar", type="boolean", nullable=false)
  199.      */
  200.     private $defaultCalendar;
  201.     /**
  202.      * @ORM\Column(name="us_auth_token",type="string", length=255, nullable=true)
  203.      */
  204.     private $authToken;
  205.     /**
  206.      * @var \DateTime
  207.      * @ORM\Column(name="us_date_active_session", type="datetime", nullable=true)
  208.      */
  209.     private $dateActiveSession;
  210.     /**
  211.      * @return type
  212.      */
  213.     public function getId() {
  214.         return $this->id;
  215.     }
  216.     /**
  217.      * @return type
  218.      */
  219.     public function getSecondPass() {
  220.         return $this->secondPass;
  221.     }
  222.     /**
  223.      * @param type $secondPass
  224.      */
  225.     public function setSecondPass($secondPass) {
  226.         $this->secondPass $secondPass;
  227.     }
  228.     /**
  229.      * @return type
  230.      */
  231.     public function getUsType() {
  232.         return $this->usType;
  233.     }
  234.     /**
  235.      * @param type $usType
  236.      */
  237.     public function setUsType($usType) {
  238.         $this->usType $usType;
  239.     }
  240.     /**
  241.      * @return string
  242.      */
  243.     public function getUsName() {
  244.         return $this->usName;
  245.     }
  246.     /**
  247.      * @return string
  248.      */
  249.     public function getUsLastName() {
  250.         return $this->usLastName;
  251.     }
  252.     /**
  253.      * @return type
  254.      */
  255.     public function getUsEmail() {
  256.         return $this->usEmail;
  257.     }
  258.     /**
  259.      * @return type
  260.      */
  261.     public function getUsPhoneNumber() {
  262.         return $this->usPhoneNumber;
  263.     }
  264.     /**
  265.      * @return  string
  266.      */ 
  267.     public function getUsPhonePrefix(){
  268.         return $this->usPhonePrefix;
  269.     }
  270.     /**
  271.      * @return type
  272.      */
  273.     public function getUsDateCreated() {
  274.         return $this->usDateCreated;
  275.     }
  276.     /**
  277.      * @return type
  278.      */
  279.     public function getUsStatus() {
  280.         return $this->usStatus;
  281.     }
  282.     /**
  283.      * @return type
  284.      */
  285.     public function getUsUserParent() {
  286.         return $this->usUserParent;
  287.     }
  288.     /**
  289.      * @return \App\Entity\Company
  290.      */
  291.     public function getUsCompany() {
  292.         return $this->usCompany;
  293.     }
  294.     /**
  295.      * @param type $usName
  296.      */
  297.     public function setUsName($usName) {
  298.         $this->usName $usName;
  299.     }
  300.     /**
  301.      * @param type $usLastName
  302.      */
  303.     public function setUsLastName($usLastName) {
  304.         $this->usLastName $usLastName;
  305.     }
  306.     /**
  307.      * @param type $usEmail
  308.      */
  309.     public function setUsEmail($usEmail) {
  310.         $this->usEmail $usEmail;
  311.     }
  312.     /**
  313.      * @param type $usPhoneNumber
  314.      */
  315.     public function setUsPhoneNumber($usPhoneNumber) {
  316.         $this->usPhoneNumber $usPhoneNumber;
  317.     }
  318.     /**
  319.      * @param  string  $usPhonePrefix
  320.      */ 
  321.     public function setUsPhonePrefix(string $usPhonePrefix){
  322.         $this->usPhonePrefix $usPhonePrefix;
  323.     }
  324.     /**
  325.      * @param \DateTime $usDateCreated
  326.      */
  327.     public function setUsDateCreated(\DateTime $usDateCreated null) {
  328.         $this->usDateCreated $usDateCreated;
  329.     }
  330.     /**
  331.      * @param type $usStatus
  332.      */
  333.     public function setUsStatus($usStatus) {
  334.         $this->usStatus $usStatus;
  335.     }
  336.     /**
  337.      * @param type $usUserParent
  338.      */
  339.     public function setUsUserParent($usUserParent) {
  340.         $this->usUserParent $usUserParent;
  341.     }
  342.     /**
  343.      * @param Company $usCompany
  344.      */
  345.     public function setUsCompany(\App\Entity\Company $usCompany null) {
  346.         $this->usCompany $usCompany;
  347.     }
  348.     /**
  349.      * @return type
  350.      */
  351.     public function getUsername() {
  352.         return $this->username;
  353.     }
  354.     /**
  355.      * @param type $username
  356.      */
  357.     public function setUsername($username) {
  358.         $this->username $username;
  359.     }
  360.     /**
  361.      * @return type
  362.      */
  363.     public function getDeleted() {
  364.         return $this->deleted;
  365.     }
  366.     /**
  367.      * @param type $deleted
  368.      */
  369.     public function setDeleted($deleted) {
  370.         $this->deleted $deleted;
  371.     }
  372.     /**
  373.      * @ORM\PrePersist
  374.      */
  375.     public function defaultDeleted() {
  376.         $this->deleted false;
  377.     }
  378.     /**
  379.      * @return type
  380.      */
  381.     public function getIsOMTUser() {
  382.         return $this->isOMTUser;
  383.     }
  384.     /**
  385.      * @param type $isOMTUser
  386.      */
  387.     public function setIsOMTUser($isOMTUser) {
  388.         $this->isOMTUser $isOMTUser;
  389.     }
  390.     /**
  391.      * Get Roles
  392.      * @return Array
  393.      */
  394.     public function getRoles() {
  395.         $companyStatus Company::STATUS_INACTIVE;
  396.         $isSuperAdmin = static::USER_SUPER_ADMIN;
  397.         if ($this->getUsCompany()->getCoStatus() == $companyStatus && $isSuperAdmin != $this->usType) {
  398.             return ['ROLE_INACTIVE'];
  399.         }
  400.         $return = ['ROLE_INACTIVE'];
  401.         if ($this->getDeleted() == false) {
  402.             if ($this->usStatus == static::STATUS_ACTIVE) {
  403.                 if ($this->usType == static::USER_ADMINISTRATOR) {
  404.                     $return = ['ROLE_ADMINISTRATOR'];
  405.                 } elseif ($this->usType == static::USER_SUPER_ADMIN) {
  406.                     $return = ['ROLE_SUPER_ADMIN'];
  407.                 } elseif ($this->usType == static::USER_LICENSE_MANAGER) {
  408.                     $return = ['ROLE_LICENSE_MANAGER'];
  409.                 } elseif ($this->usType == static::USER_REPORT_VIEWER) {
  410.                     $return = ['ROLE_REPORT_VIEWER'];
  411.                 } elseif ($this->usType == static::USER_ADMIN_DATABASES) {
  412.                     $return = ['ROLE_ADMIN_DATABASES'];
  413.                 } elseif ($this->usType == static::USER_TICKET_SUPPORT) {
  414.                     $return = ['ROLE_TICKET_SUPPORT'];
  415.                 } elseif ($this->usType == static::USER_AGENT_MANAGER) {
  416.                     $return = ['ROLE_AGENT_MANAGER'];
  417.                 } elseif ($this->usType == static::USER_AGENT) {
  418.                     $return = ['ROLE_AGENT'];
  419.                 } elseif ($this->usType == static::USER_RESELLER) {
  420.                     $return = ['ROLE_RESELLER'];
  421.                 } elseif ($this->usType == static::USER_SUB_RESELLER) {
  422.                     $return = ['ROLE_SUB_RESELLER'];
  423.                 } elseif ($this->usType == static::USER_SUB_SUB_RESELLER) {
  424.                     $return = ['ROLE_SUB_SUB_RESELLER'];
  425.                 } elseif ($this->usType == static::USER_INTERNAL_SUPPORT) {
  426.                     $return = ['ROLE_INTERNAL_SUPPORT'];
  427.                 }
  428.             } elseif ($this->usStatus == static::STATUS_INACTIVE) {
  429.                 $return = ['ROLE_INACTIVE'];
  430.             }
  431.         }
  432.         return $return;
  433.     }
  434.     /**
  435.      * get text status Active Inactive
  436.      * @return string
  437.      */
  438.     public function getTextStatus() {
  439.         $text '';
  440.         switch ($this->usStatus) {
  441.             case static::STATUS_ACTIVE$text 'Active';
  442.                 break;
  443.             case static::STATUS_INACTIVE$text 'Inactive';
  444.                 break;
  445.             default:
  446.                 $text 'Inactive';
  447.         }
  448.         return $text;
  449.     }
  450.     /**
  451.      * Get text type super_admin, administrator, license_manager,
  452.      * report_viewer, data_bases_administrator
  453.      * @return string
  454.      */
  455.     public function getTextType() {
  456.         $text '';
  457.         switch ($this->usType) {
  458.             case static::USER_SUPER_ADMIN$text 'Super Admin';
  459.                 break;
  460.             case static::USER_ADMINISTRATOR$text 'Administrator';
  461.                 break;
  462.             case static::USER_LICENSE_MANAGER$text 'License Manager';
  463.                 break;
  464.             case static::USER_REPORT_VIEWER$text 'Report Viewer';
  465.                 break;
  466.             case static::USER_ADMIN_DATABASES$text 'Data Bases Administrator';
  467.                 break;
  468.             case static::USER_TICKET_SUPPORT$text 'Ticket Support';
  469.                 break;
  470.             case static::USER_AGENT_MANAGER$text 'Agent Manager';
  471.                 break;
  472.             case static::USER_AGENT$text 'Agent';
  473.                 break;
  474.             case static::USER_RESELLER$text 'Reseller';
  475.                 break;
  476.             case static::USER_SUB_RESELLER$text 'Sub-reseller';
  477.                 break;
  478.             case static::USER_SUB_SUB_RESELLER$text 'Sub-Sub-reseller';
  479.                 break;
  480.             case static::USER_INTERNAL_SUPPORT$text 'Internal Support';
  481.                 break;
  482.             default:
  483.                 $text 'Report Viewer';
  484.         }
  485.         return $text;
  486.     }
  487.     /**
  488.      * @return type
  489.      */
  490.     public function serialize() {
  491.         return serialize([
  492.             $this->id,
  493.             $this->usType,
  494.             $this->usName,
  495.             $this->usLastName,
  496.             $this->usEmail,
  497.             $this->usPhoneNumber,
  498.             $this->usStatus,
  499.             $this->usDateCreated,
  500.             $this->usCompany,
  501.             $this->username,
  502.             $this->password,
  503.             $this->salt
  504.         ]);
  505.     }
  506.     /**
  507.      * @param type $serialized
  508.      */
  509.     public function unserialize($serialized) {
  510.         list(
  511.             $this->id,
  512.             $this->usType,
  513.             $this->usName,
  514.             $this->usLastName,
  515.             $this->usEmail,
  516.             $this->usPhoneNumber,
  517.             $this->usStatus,
  518.             $this->usDateCreated,
  519.             $this->usCompany,
  520.             $this->username,
  521.             $this->password,
  522.             $this->salt
  523.         ) = unserialize($serialized);
  524.     }
  525.     /**
  526.      * @param type $usPassword
  527.      */
  528.     public function setPassword($usPassword) {
  529.         $this->password $usPassword;
  530.     }
  531.     /**
  532.      * @return type
  533.      */
  534.     public function getPassword() {
  535.         return $this->password;
  536.     }
  537.     /**
  538.      * @param type $credentials
  539.      */
  540.     public function setCredentials($credentials) {
  541.         $this->credentials $credentials;
  542.     }
  543.     /**
  544.      * @return type
  545.      */
  546.     public function getCredentials() {
  547.         return $this->credentials;
  548.     }
  549.     /**
  550.      * @param type $salt
  551.      */
  552.     public function setSalt($salt) {
  553.         $this->salt $salt;
  554.     }
  555.     /**
  556.      * @return type
  557.      */
  558.     public function getSalt() {
  559.         return $this->salt;
  560.     }
  561.     public function eraseCredentials() {
  562.         
  563.     }
  564.     /**
  565.      * @return type
  566.      */
  567.     public function __toString() {
  568.         return $this->getUsName();
  569.     }
  570.     /**
  571.      * Filter Searach Parameters organiza el WHERE
  572.      * @param String $alias
  573.      * @param Array $search
  574.      * @return Array
  575.      */
  576.     public static function filterSearchParameters($alias$search) {
  577.         $textParameters $join =  '';
  578.         $parameters = [];
  579.         if (isset($search['usName']) && $search['usName'] != '') {
  580.             $textParameters .= " AND " $alias ".usName LIKE :usName";
  581.             $parameters['usName'] = "%" $search['usName'] . "%";
  582.         }
  583.         if (isset($search['usLastName']) && $search['usLastName'] != '') {
  584.             $textParameters .= " AND " $alias ".usLastName LIKE :usLastName";
  585.             $parameters['usLastName'] = "%" $search['usLastName'] . "%";
  586.         }
  587.         if (isset($search['usEmail']) && $search['usEmail'] != '') {
  588.             $textParameters .= " AND " $alias ".usEmail LIKE :usEmail";
  589.             $parameters['usEmail'] = "%" $search['usEmail'] . "%";
  590.         }
  591.         if (isset($search['usPhoneNumber']) && $search['usPhoneNumber'] != '') {
  592.             $textParameters .= " AND " $alias ".usPhoneNumber LIKE :usPhoneNumber";
  593.             $parameters['usPhoneNumber'] = "%" $search['usPhoneNumber'] . "%";
  594.         }
  595.         if (isset($search['usStatus']) && $search['usStatus'] != '') {
  596.             $textParameters .= " AND " $alias ".usStatus = :usStatus";
  597.             $parameters['usStatus'] = $search['usStatus'];
  598.         }
  599.         if (isset($search['usType']) && $search['usType'] != '') {
  600.             $textParameters .= " AND " $alias ".usType = :usType";
  601.             $parameters['usType'] = $search['usType'];
  602.         }
  603.         if (isset($search['deleted'])) {
  604.             $textParameters .= " AND " $alias ".deleted = :deleted";
  605.             $parameters['deleted'] = $search['deleted'];
  606.         }
  607.         if (isset($search['assignedState'])) {
  608.             $textParameters .= " AND " .  "AAS.state = :assignedState";
  609.             $parameters['assignedState'] = $search['assignedState'];
  610.             $join .= " INNER JOIN App\Entity\AgentsAssignedStates AAS WITH AAS.agent = $alias.id ";
  611.         }
  612.         return ['text' => $textParameters'parameters' => $parameters'join' =>$join];
  613.     }
  614.     /**
  615.      * filter order parameters para consulta DQL segun el order solicitado
  616.      * @param String $alias
  617.      * @param Array $order
  618.      * @return string el ORDER BY adecuado segun corresponda
  619.      */
  620.     public static function filterOrderParameters($alias$order) {
  621.         $orderBy ' ORDER BY ' $alias '.usName ASC';
  622.         if (isset($order ['order_by_user_name']) && $order ['order_by_user_name'] != '') {
  623.             if ($order ['order_by_user_name'] % 2) {
  624.                 $orderBy " ORDER BY " $alias ".usName DESC";
  625.             } else {
  626.                 $orderBy " ORDER BY " $alias ".usName ASC";
  627.             }
  628.         } elseif (isset($order ['order_by_user_email']) && $order ['order_by_user_email'] != '') {
  629.             if ($order ['order_by_user_email'] % 2) {
  630.                 $orderBy " ORDER BY " $alias ".usEmail DESC";
  631.             } else {
  632.                 $orderBy " ORDER BY " $alias ".usEmail ASC";
  633.             }
  634.         } elseif (isset($order ['order_by_user_status']) && $order ['order_by_user_status'] != '') {
  635.             if ($order ['order_by_user_status'] % 2) {
  636.                 $orderBy " ORDER BY " $alias ".usStatus DESC";
  637.             } else {
  638.                 $orderBy " ORDER BY " $alias ".usStatus ASC";
  639.             }
  640.         } elseif (isset($order ['order_by_user_type']) && $order ['order_by_user_type'] != '') {
  641.             if ($order ['order_by_user_type'] % 2) {
  642.                 $orderBy " ORDER BY " $alias ".usType DESC";
  643.             } else {
  644.                 $orderBy " ORDER BY " $alias ".usType ASC";
  645.             }
  646.         }
  647.         return $orderBy;
  648.     }   
  649.     public function getState()
  650.     {
  651.         return $this->state;
  652.     }
  653.     public function setState($state)
  654.     {
  655.         $this->state $state;
  656.         return $this;
  657.     }
  658.     public function getCountry()
  659.     {
  660.         return $this->country;
  661.     }
  662.     public function setCountry($country)
  663.     {
  664.         $this->country $country;
  665.         return $this;
  666.     }
  667.     public function getTimeZone()
  668.     {
  669.         return $this->timeZone;
  670.     }
  671.     public function setTimeZone($timeZone)
  672.     {
  673.         $this->timeZone $timeZone;
  674.         return $this;
  675.     }
  676.     public function getWorktime()
  677.     {
  678.         return $this->worktime;
  679.     }
  680.     public function setWorktime($worktime){
  681.         $this->worktime $worktime;
  682.     }
  683.     /**
  684.      * @return string
  685.      */
  686.     public function getUserIdentifier() {
  687.         return $this->username;
  688.     }
  689.     /**
  690.      * Get the value of defaultCalendar
  691.      *
  692.      * @return  string
  693.      */ 
  694.     public function getDefaultCalendar()
  695.     {
  696.         return $this->defaultCalendar;
  697.     }
  698.     /**
  699.      * Set the value of defaultCalendar
  700.      *
  701.      * @param  string  $defaultCalendar
  702.      *
  703.      * @return  self
  704.      */ 
  705.     public function setDefaultCalendar(string $defaultCalendar)
  706.     {
  707.         $this->defaultCalendar $defaultCalendar;
  708.         return $this;
  709.     }
  710.     /**
  711.      * Función para pasar a de tipo objeto-entidad a json
  712.      */
  713.     public function showEverything() {
  714.         return get_object_vars($this);
  715.     }
  716.     public function getValidatePhone()
  717.     {
  718.         return $this->validatePhone;
  719.     }
  720.     public function setValidatePhone($validatePhone)
  721.     {
  722.         $this->validatePhone $validatePhone;
  723.         return $this;
  724.     }
  725.     /**
  726.      * Get Partner
  727.      */
  728.     public function getPartner(){
  729.         return $this->partner;
  730.     }
  731.     /**
  732.      * Set Partner
  733.      */
  734.     public function setPartner(Partner $partner){
  735.         $this->partner $partner;
  736.     }
  737.     /**
  738.      * Get the value of isSubagent
  739.      */ 
  740.     public function getIsSubagent()
  741.     {
  742.         return $this->isSubagent;
  743.     }
  744.     /**
  745.      * Set the value of isSubagent
  746.      * @param  $isSubagent
  747.      */ 
  748.     public function setIsSubagent($isSubagent)
  749.     {
  750.         $this->isSubagent $isSubagent;
  751.     }
  752.     /**
  753.      * Get the value of isSuperAgentManager
  754.      */ 
  755.     public function getIsSuperAgentManager()
  756.     {
  757.         return $this->isSuperAgentManager;
  758.     }
  759.     /**
  760.      * Set the value of isSuperAgentManager
  761.      * @param  $isSuperAgentManager
  762.      */ 
  763.     public function setIsSuperAgentManager($isSuperAgentManager)
  764.     {
  765.         $this->isSuperAgentManager $isSuperAgentManager;
  766.     }
  767.     /**
  768.      * Get the value of authToken
  769.      */ 
  770.     public function getAuthToken()
  771.     {
  772.         return $this->authToken;
  773.     }
  774.     /**
  775.      * Set the value of authToken
  776.      * @param  $authToken
  777.      */ 
  778.     public function setAuthToken($authToken)
  779.     {
  780.         $this->authToken $authToken;
  781.     }
  782.     /**
  783.      * Get the value of dateActiveSession
  784.      */ 
  785.     public function getDateActiveSession()
  786.     {
  787.         return $this->dateActiveSession;
  788.     }
  789.     /**
  790.      * Set the value of dateActiveSession
  791.      */ 
  792.     public function setDateActiveSession($dateActiveSession)
  793.     {
  794.         $this->dateActiveSession $dateActiveSession;
  795.     }
  796. }