src/AppBundle/MainBundle/Entity/Users_Referrals.php line 359

Open in your IDE?
  1. <?php
  2. namespace App\AppBundle\MainBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Criteria;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use JsonSerializable;
  8. use DateTime;
  9. /**
  10.  * AddOns
  11.  *
  12.  * @ORM\Entity(repositoryClass="App\AppBundle\MainBundle\Repository\Users_ReferralsRepository")
  13.  * @ORM\Table(name="users_referrals")
  14.  * @ORM\HasLifecycleCallbacks()
  15.  */
  16. class Users_Referrals implements JsonSerializable
  17. {
  18.     /**
  19.      * @ORM\Column(type="integer")
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue(strategy="AUTO")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var User
  26.      * @ORM\ManyToOne(targetEntity="User", inversedBy="orders")
  27.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  28.      */
  29.     private $user;
  30.     /**
  31.      * @var User
  32.      * @ORM\ManyToOne(targetEntity="User", inversedBy="orders")
  33.      * @ORM\JoinColumn(name="source_user_id", referencedColumnName="id")
  34.      */
  35.     private $source_user;
  36.     /**
  37.      * @var PromoCodes
  38.      * @ORM\ManyToOne(targetEntity="PromoCodes")
  39.      * @ORM\JoinColumn(name="user_promo_code_spot_seeker_task_id", referencedColumnName="id", nullable=true)
  40.      */
  41.     private $user_promo_code_spot_seeker_task;
  42.     /**
  43.      * @var PromoCodes
  44.      * @ORM\ManyToOne(targetEntity="PromoCodes")
  45.      * @ORM\JoinColumn(name="source_user_promo_code_spot_seeker_task_id", referencedColumnName="id", nullable=true)
  46.      */
  47.     private $source_user_promo_code_spot_seeker_task;
  48.     /**
  49.      * @var PromoCodes
  50.      * @ORM\ManyToOne(targetEntity="PromoCodes")
  51.      * @ORM\JoinColumn(name="user_promo_code_spot_owner_task_id", referencedColumnName="id", nullable=true)
  52.      */
  53.     private $user_promo_code_spot_owner_task;
  54.     /**
  55.      * @var PromoCodes
  56.      * @ORM\ManyToOne(targetEntity="PromoCodes")
  57.      * @ORM\JoinColumn(name="source_user_promo_code_spot_owner_task_id", referencedColumnName="id", nullable=true)
  58.      */
  59.     private $source_user_promo_code_spot_owner_task;
  60.     /**
  61.      * @var PromoCodes
  62.      * @ORM\ManyToOne(targetEntity="PromoCodes")
  63.      * @ORM\JoinColumn(name="user_promo_code_user_sign_up_task_id", referencedColumnName="id", nullable=true)
  64.      */
  65.     private $user_promo_code_user_sign_up_task;
  66.     /**
  67.      * @var PromoCodes
  68.      * @ORM\ManyToOne(targetEntity="PromoCodes")
  69.      * @ORM\JoinColumn(name="source_user_promo_code_user_sign_up_task_id", referencedColumnName="id", nullable=true)
  70.      */
  71.     private $source_user_promo_code_user_sign_up_task;
  72.     /**
  73.      * @ORM\Column(type="boolean", nullable=false, options={"default" : 1})
  74.      */
  75.     private $active true;
  76.     /**
  77.      * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  78.      */
  79.     private $is_spot_seeker_task_completed false;
  80.     /**
  81.      * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  82.      */
  83.     private $is_spot_owner_task_completed false;
  84.     /**
  85.      * @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
  86.      */
  87.     private $is_user_sign_up_task_completed false;
  88.     /**
  89.      * @return mixed
  90.      */
  91.     public function getId()
  92.     {
  93.         return $this->id;
  94.     }
  95.     /**
  96.      * @return User
  97.      */
  98.     public function getUser()
  99.     {
  100.         return $this->user;
  101.     }
  102.     /**
  103.      * @param User $user
  104.      */
  105.     public function setUser(User $user)
  106.     {
  107.         $this->user $user;
  108.     }
  109.     /**
  110.      * @return User
  111.      */
  112.     public function getSourceUser()
  113.     {
  114.         return $this->source_user;
  115.     }
  116.     /**
  117.      * @param User $source_user
  118.      */
  119.     public function setSourceUser(User $source_user)
  120.     {
  121.         $this->source_user $source_user;
  122.     }
  123.     /**
  124.      * @return PromoCodes
  125.      */
  126.     public function getUserPromoCodeSpotSeekerTask()
  127.     {
  128.         return $this->user_promo_code_spot_seeker_task;
  129.     }
  130.     /**
  131.      * @param PromoCodes $user_promo_code_spot_seeker_task
  132.      */
  133.     public function setUserPromoCodeSpotSeekerTask(PromoCodes $user_promo_code_spot_seeker_task)
  134.     {
  135.         $this->user_promo_code_spot_seeker_task $user_promo_code_spot_seeker_task;
  136.     }
  137.     /**
  138.      * @return PromoCodes
  139.      */
  140.     public function getSourceUserPromoCodeSpotSeekerTask()
  141.     {
  142.         return $this->source_user_promo_code_spot_seeker_task;
  143.     }
  144.     /**
  145.      * @param PromoCodes $source_user_promo_code_spot_seeker_task
  146.      */
  147.     public function setSourceUserPromoCodeSpotSeekerTask(PromoCodes $source_user_promo_code_spot_seeker_task)
  148.     {
  149.         $this->source_user_promo_code_spot_seeker_task $source_user_promo_code_spot_seeker_task;
  150.     }
  151.     /**
  152.      * @return PromoCodes
  153.      */
  154.     public function getUserPromoCodeSpotOwnerTask()
  155.     {
  156.         return $this->user_promo_code_spot_owner_task;
  157.     }
  158.     /**
  159.      * @param PromoCodes $user_promo_code_spot_owner_task
  160.      */
  161.     public function setUserPromoCodeSpotOwnerTask(PromoCodes $user_promo_code_spot_owner_task)
  162.     {
  163.         $this->user_promo_code_spot_owner_task $user_promo_code_spot_owner_task;
  164.     }
  165.     /**
  166.      * @return PromoCodes
  167.      */
  168.     public function getSourceUserPromoCodeSpotOwnerTask()
  169.     {
  170.         return $this->source_user_promo_code_spot_owner_task;
  171.     }
  172.     /**
  173.      * @param PromoCodes $source_user_promo_code_spot_owner_task
  174.      */
  175.     public function setSourceUserPromoCodeSpotOwnerTask(PromoCodes $source_user_promo_code_spot_owner_task)
  176.     {
  177.         $this->source_user_promo_code_spot_owner_task $source_user_promo_code_spot_owner_task;
  178.     }
  179.     /**
  180.      * @return PromoCodes
  181.      */
  182.     public function getUserPromoCodeUserSignUpTask()
  183.     {
  184.         return $this->user_promo_code_user_sign_up_task;
  185.     }
  186.     /**
  187.      * @param PromoCodes $user_promo_code_user_sign_up_task
  188.      */
  189.     public function setUserPromoCodeUserSignUpTask(PromoCodes $user_promo_code_user_sign_up_task)
  190.     {
  191.         $this->user_promo_code_user_sign_up_task $user_promo_code_user_sign_up_task;
  192.     }
  193.     /**
  194.      * @return PromoCodes
  195.      */
  196.     public function getSourceUserPromoCodeUserSignUpTask()
  197.     {
  198.         return $this->source_user_promo_code_user_sign_up_task;
  199.     }
  200.     /**
  201.      * @param PromoCodes $source_user_promo_code_user_sign_up_task
  202.      */
  203.     public function setSourceUserPromoCodeUserSignUpTask(PromoCodes $source_user_promo_code_user_sign_up_task)
  204.     {
  205.         $this->source_user_promo_code_user_sign_up_task $source_user_promo_code_user_sign_up_task;
  206.     }
  207.     /**
  208.      * @return mixed
  209.      */
  210.     public function getActive()
  211.     {
  212.         return $this->active;
  213.     }
  214.     /**
  215.      * @param mixed $active
  216.      */
  217.     public function setActive($active)
  218.     {
  219.         $this->active $active;
  220.     }
  221.     /**
  222.      * @return mixed
  223.      */
  224.     public function getIsSpotSeekerTaskCompleted()
  225.     {
  226.         return $this->is_spot_seeker_task_completed;
  227.     }
  228.     /**
  229.      * @param mixed $is_spot_seeker_task_completed
  230.      */
  231.     public function setIsSpotSeekerTaskCompleted($is_spot_seeker_task_completed)
  232.     {
  233.         $this->is_spot_seeker_task_completed $is_spot_seeker_task_completed;
  234.     }
  235.     /**
  236.      * @return mixed
  237.      */
  238.     public function getIsSpotOwnerTaskCompleted()
  239.     {
  240.         return $this->is_spot_owner_task_completed;
  241.     }
  242.     /**
  243.      * @param mixed $is_spot_owner_task_completed
  244.      */
  245.     public function setIsSpotOwnerTaskCompleted($is_spot_owner_task_completed)
  246.     {
  247.         $this->is_spot_owner_task_completed $is_spot_owner_task_completed;
  248.     }
  249.     /**
  250.      * @return mixed
  251.      */
  252.     public function getIsUserSignUpTaskCompleted()
  253.     {
  254.         return $this->is_user_sign_up_task_completed;
  255.     }
  256.     /**
  257.      * @param mixed $is_user_sign_up_task_completed
  258.      */
  259.     public function setIsUserSignUpTaskCompleted($is_user_sign_up_task_completed)
  260.     {
  261.         $this->is_user_sign_up_task_completed $is_user_sign_up_task_completed;
  262.     }
  263.     public function jsonSerialize()
  264.     {
  265.         return array(
  266.             'id' => $this->id,
  267.             'user_id' => $this->getUser()->getId(),
  268.             'source_user_id' => $this->getSourceUser()->getId(),
  269.             'source_user_first_name' => $this->getSourceUser()->getFirstName(),
  270.             'source_user_last_name' => $this->getSourceUser()->getLastName(),
  271.             'source_user_invite_code' => $this->getSourceUser()->getInviteCode(),
  272.         );
  273.     }
  274.     /**
  275.      * @var string $created
  276.      *
  277.      * @ORM\Column(name="created_at", type="string", nullable=false)
  278.      */
  279.     protected $createdAt;
  280.     /**
  281.      * @var string $updated
  282.      *
  283.      * @ORM\Column(name="updated_at", type="string", nullable=false)
  284.      */
  285.     protected $updatedAt;
  286.     public function getCreatedAt()
  287.     {
  288.         return $this->createdAt;
  289.     }
  290.     public function setCreatedAt($createdAt)
  291.     {
  292.         $this->createdAt $createdAt;
  293.         return $this;
  294.     }
  295.     public function getUpdatedAt()
  296.     {
  297.         return $this->updatedAt;
  298.     }
  299.     public function setUpdatedAt($updatedAt)
  300.     {
  301.         $this->updatedAt $updatedAt;
  302.         return $this;
  303.     }
  304.     /**
  305.      * @ORM\PrePersist
  306.      * @ORM\PreUpdate
  307.      */
  308.     public function updatedTimestamps()
  309.     {
  310.         $this->setUpdatedAt(round(microtime(true) * 1000));
  311.         if ($this->getCreatedAt() === null) {
  312.             $this->setCreatedAt(round(microtime(true) * 1000));
  313.         }
  314.     }
  315.     public function __construct() {
  316.         $this->setCreatedAt(round(microtime(true) * 1000));
  317.     }
  318. }