src/Entity/Customer/Customer.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Customer;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Table(name="customer")
  6.  * @ORM\Entity()
  7.  * @ORM\HasLifecycleCallbacks()
  8.  */
  9. class Customer
  10. {
  11.     /**
  12.      * @ORM\Column(type="integer")
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue(strategy="AUTO")
  15.      */
  16.     protected $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     protected $photo;
  21.     /**
  22.      * @ORM\Column(type="string", length=100)
  23.      */
  24.     protected $firstname;
  25.     /**
  26.      * @ORM\Column(type="string", length=100)
  27.      */
  28.     protected $lastname;
  29.     /**
  30.      * @ORM\Column(type="string", length=100)
  31.      */
  32.     protected $business_name;
  33.     /**
  34.      * @ORM\Column(type="string", length=100)
  35.      */
  36.     protected $business_identification;
  37.     /**
  38.      * @ORM\Column(type="string", length=100)
  39.      */
  40.     protected $code;
  41.     /**
  42.      * @ORM\Column(type="string", length=1000)
  43.      */
  44.     protected $customers;
  45.     /**
  46.      * @var string
  47.      *
  48.      * @ORM\Column(name="email", type="string", length=255, nullable=true)
  49.      */
  50.     private $email;
  51.     
  52.     /**
  53.      * @var string
  54.      *
  55.      * @ORM\Column(name="username", type="string", length=255, nullable=true, unique=true)
  56.      */
  57.     private $username;
  58.     /**
  59.      * @var string
  60.      *
  61.      * @ORM\Column(name="password", type="string", length=255, nullable=true)
  62.      */
  63.     private $password;
  64.     /**
  65.      * @var string
  66.      *
  67.      * @ORM\Column(name="telephone1", type="string", length=100, nullable=true)
  68.      */
  69.     private $telephone1;
  70.     /**
  71.      * @var string
  72.      *
  73.      * @ORM\Column(name="telephone2", type="string", length=100, nullable=true)
  74.      */
  75.     private $telephone2;
  76.     /**
  77.      * @var string
  78.      *
  79.      * @ORM\Column(type="boolean")
  80.      */
  81.     private $is_admin;
  82.     /**
  83.      * @var boolean
  84.      *
  85.      * @ORM\Column(name="enabled", type="boolean", nullable=true)
  86.      */
  87.     private $enabled true;
  88.     /**
  89.      * @var last_login
  90.      *
  91.      * @ORM\Column(type="datetime")
  92.      */
  93.     private $last_login;
  94.     public function __toString()
  95.     {
  96.         return $this->getFirstname().' '.$this->getLastname();
  97.     }
  98.     public function getPhoto()
  99.     {
  100.         return $this->photo;
  101.     }
  102.     
  103.     public function getEmail()
  104.     {
  105.         return $this->email;
  106.     }
  107.     /**
  108.      * Get username
  109.      *
  110.      * @return string 
  111.      */
  112.     public function getUsername()
  113.     {
  114.         return $this->username;
  115.     }
  116.     /**
  117.      * Get password
  118.      *
  119.      * @return string 
  120.      */
  121.     public function getPassword()
  122.     {
  123.         return $this->password;
  124.     }
  125.     public function getSalt()
  126.     {
  127.         // return null beacause we are usin bcrypt
  128.         return null;
  129.     }
  130.     public function getRoles()
  131.     {
  132.         return array('ROLE_USER');
  133.     }
  134.     public function eraseCredentials()
  135.     {
  136.     }
  137.     public function isAccountNonExpired()
  138.     {
  139.         return true;
  140.     }
  141.     public function isAccountNonLocked()
  142.     {
  143.         return true;
  144.     }
  145.     public function isCredentialsNonExpired()
  146.     {
  147.         return true;
  148.     }
  149.     public function isEnabled()
  150.     {
  151.         return $this->enabled;
  152.     }
  153.     // serialize and unserialize must be updated - see below
  154.     public function serialize()
  155.     {
  156.         return serialize(array(
  157.             $this->id,
  158.             $this->username,
  159.             $this->password,
  160.             $this->enabled
  161.         ));
  162.     }
  163.     public function unserialize($serialized)
  164.     {
  165.         list (
  166.             $this->id,
  167.             $this->username,
  168.             $this->password,
  169.             $this->enabled
  170.         ) = unserialize($serialized);
  171.     }
  172.     
  173.     // super lame fix
  174.     public function getUserType()
  175.     {
  176.         return 2;
  177.     }
  178.     /**
  179.      * Set firstname
  180.      *
  181.      * @param string $firstname
  182.      * @return User
  183.      */
  184.     public function setFirstname($firstname)
  185.     {
  186.         $this->firstname $firstname;
  187.         return $this;
  188.     }
  189.     /**
  190.      * Get firstname
  191.      *
  192.      * @return string 
  193.      */
  194.     public function getFirstname()
  195.     {
  196.         return $this->firstname;
  197.     }
  198.     /**
  199.      * Set lastname
  200.      *
  201.      * @param string $lastname
  202.      * @return User
  203.      */
  204.     public function setLastname($lastname)
  205.     {
  206.         $this->lastname $lastname;
  207.         return $this;
  208.     }
  209.     /**
  210.      * Get lastname
  211.      *
  212.      * @return string 
  213.      */
  214.     public function getLastname()
  215.     {
  216.         return $this->lastname;
  217.     }
  218.     /**
  219.      * Set business_name
  220.      *
  221.      * @param string $business_name
  222.      * @return User
  223.      */
  224.     public function setBusinessName($business_name)
  225.     {
  226.         $this->business_name $business_name;
  227.         return $this;
  228.     }
  229.     /**
  230.      * Get business_name
  231.      *
  232.      * @return string 
  233.      */
  234.     public function getBusinessName()
  235.     {
  236.         return $this->business_name;
  237.     }
  238.     /**
  239.      * Set business_identification
  240.      *
  241.      * @param string $business_identification
  242.      * @return User
  243.      */
  244.     public function setBusinessIdentification($business_identification)
  245.     {
  246.         $this->business_identification $business_identification;
  247.         return $this;
  248.     }
  249.     /**
  250.      * Get business_identification
  251.      *
  252.      * @return string 
  253.      */
  254.     public function getBusinessIdentification()
  255.     {
  256.         return $this->business_identification;
  257.     }
  258.     /**
  259.      * Set code
  260.      *
  261.      * @param string $code
  262.      * @return User
  263.      */
  264.     public function setCode($code)
  265.     {
  266.         $this->code $code;
  267.         return $this;
  268.     }
  269.     /**
  270.      * Get code
  271.      *
  272.      * @return string 
  273.      */
  274.     public function getCode()
  275.     {
  276.         return $this->code;
  277.     }
  278.     /**
  279.      * Set customers
  280.      *
  281.      * @param string $customers
  282.      * @return User
  283.      */
  284.     public function setCustomers($customers)
  285.     {
  286.         $this->customers $customers;
  287.         return $this;
  288.     }
  289.     /**
  290.      * Get customers
  291.      *
  292.      * @return string 
  293.      */
  294.     public function getCustomers()
  295.     {
  296.         return $this->customers;
  297.     }
  298.     /**
  299.      * Set email
  300.      *
  301.      * @param string $email
  302.      * @return User
  303.      */
  304.     public function setEmail($email)
  305.     {
  306.         $this->email $email;
  307.         return $this;
  308.     }
  309.     /**
  310.      * Set username
  311.      *
  312.      * @param string $username
  313.      * @return User
  314.      */
  315.     public function setUsername($username)
  316.     {
  317.         $this->username $username;
  318.         return $this;
  319.     }
  320.     /**
  321.      * Set password
  322.      *
  323.      * @param string $password
  324.      * @return User
  325.      */
  326.     public function setPassword($password)
  327.     {
  328.         $this->password $password;
  329.         return $this;
  330.     }
  331.     /**
  332.      * Set enabled
  333.      *
  334.      * @param boolean $enabled
  335.      * @return User
  336.      */
  337.     public function setEnabled($enabled)
  338.     {
  339.         $this->enabled $enabled;
  340.         return $this;
  341.     }
  342.     /**
  343.      * Get enabled
  344.      *
  345.      * @return boolean 
  346.      */
  347.     public function getEnabled()
  348.     {
  349.         return $this->enabled;
  350.     }
  351.     /**
  352.      * Get id
  353.      *
  354.      * @return integer 
  355.      */
  356.     public function getId()
  357.     {
  358.         return $this->id;
  359.     }
  360.     /**
  361.      * Set is_admin
  362.      *
  363.      * @param string $isAdmin
  364.      * @return User
  365.      */
  366.     public function setIsAdmin($isAdmin)
  367.     {
  368.         $this->is_admin $isAdmin;
  369.         return $this;
  370.     }
  371.     /**
  372.      * Get is_admin
  373.      *
  374.      * @return string 
  375.      */
  376.     public function getIsAdmin()
  377.     {
  378.         return $this->is_admin;
  379.     }
  380.     /**
  381.      * Set photo
  382.      *
  383.      * @param string $photo
  384.      * @return User
  385.      */
  386.     public function setPhoto($photo)
  387.     {
  388.         $this->photo $photo;
  389.         return $this;
  390.     }
  391.     /**
  392.      * Set telephone1
  393.      *
  394.      * @param string $telephone1
  395.      * @return User
  396.      */
  397.     public function setTelephone1($telephone1)
  398.     {
  399.         $this->telephone1 $telephone1;
  400.         return $this;
  401.     }
  402.     /**
  403.      * Get telephone1
  404.      *
  405.      * @return string 
  406.      */
  407.     public function getTelephone1()
  408.     {
  409.         return $this->telephone1;
  410.     }
  411.     /**
  412.      * Set telephone2
  413.      *
  414.      * @param string $telephone2
  415.      * @return User
  416.      */
  417.     public function setTelephone2($telephone2)
  418.     {
  419.         $this->telephone2 $telephone2;
  420.         return $this;
  421.     }
  422.     /**
  423.      * Get telephone2
  424.      *
  425.      * @return string 
  426.      */
  427.     public function getTelephone2()
  428.     {
  429.         return $this->telephone2;
  430.     }
  431.     /**
  432.      * Set last_login
  433.      *
  434.      * @param datetime $last_login
  435.      * @return User
  436.      */
  437.     public function setLastLogin($last_login)
  438.     {
  439.         $this->last_login $last_login;
  440.         return $this;
  441.     }
  442.     /**
  443.      * Get last_login
  444.      *
  445.      * @return datetime 
  446.      */
  447.     public function getLastLogin()
  448.     {
  449.         return $this->last_login;
  450.     }
  451.     /**
  452.      * Constructor
  453.      */
  454.     public function __construct()
  455.     {
  456.     }
  457. }