<?php
namespace App\AppBundle\MainBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use JsonSerializable;
use DateTime;
/**
* AddOns
*
* @ORM\Entity(repositoryClass="App\AppBundle\MainBundle\Repository\Users_ReferralsRepository")
* @ORM\Table(name="users_referrals")
* @ORM\HasLifecycleCallbacks()
*/
class Users_Referrals implements JsonSerializable
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var User
* @ORM\ManyToOne(targetEntity="User", inversedBy="orders")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
/**
* @var User
* @ORM\ManyToOne(targetEntity="User", inversedBy="orders")
* @ORM\JoinColumn(name="source_user_id", referencedColumnName="id")
*/
private $source_user;
/**
* @var PromoCodes
* @ORM\ManyToOne(targetEntity="PromoCodes")
* @ORM\JoinColumn(name="user_promo_code_spot_seeker_task_id", referencedColumnName="id", nullable=true)
*/
private $user_promo_code_spot_seeker_task;
/**
* @var PromoCodes
* @ORM\ManyToOne(targetEntity="PromoCodes")
* @ORM\JoinColumn(name="source_user_promo_code_spot_seeker_task_id", referencedColumnName="id", nullable=true)
*/
private $source_user_promo_code_spot_seeker_task;
/**
* @var PromoCodes
* @ORM\ManyToOne(targetEntity="PromoCodes")
* @ORM\JoinColumn(name="user_promo_code_spot_owner_task_id", referencedColumnName="id", nullable=true)
*/
private $user_promo_code_spot_owner_task;
/**
* @var PromoCodes
* @ORM\ManyToOne(targetEntity="PromoCodes")
* @ORM\JoinColumn(name="source_user_promo_code_spot_owner_task_id", referencedColumnName="id", nullable=true)
*/
private $source_user_promo_code_spot_owner_task;
/**
* @var PromoCodes
* @ORM\ManyToOne(targetEntity="PromoCodes")
* @ORM\JoinColumn(name="user_promo_code_user_sign_up_task_id", referencedColumnName="id", nullable=true)
*/
private $user_promo_code_user_sign_up_task;
/**
* @var PromoCodes
* @ORM\ManyToOne(targetEntity="PromoCodes")
* @ORM\JoinColumn(name="source_user_promo_code_user_sign_up_task_id", referencedColumnName="id", nullable=true)
*/
private $source_user_promo_code_user_sign_up_task;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" : 1})
*/
private $active = true;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
*/
private $is_spot_seeker_task_completed = false;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
*/
private $is_spot_owner_task_completed = false;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" : 0})
*/
private $is_user_sign_up_task_completed = false;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/**
* @return User
*/
public function getSourceUser()
{
return $this->source_user;
}
/**
* @param User $source_user
*/
public function setSourceUser(User $source_user)
{
$this->source_user = $source_user;
}
/**
* @return PromoCodes
*/
public function getUserPromoCodeSpotSeekerTask()
{
return $this->user_promo_code_spot_seeker_task;
}
/**
* @param PromoCodes $user_promo_code_spot_seeker_task
*/
public function setUserPromoCodeSpotSeekerTask(PromoCodes $user_promo_code_spot_seeker_task)
{
$this->user_promo_code_spot_seeker_task = $user_promo_code_spot_seeker_task;
}
/**
* @return PromoCodes
*/
public function getSourceUserPromoCodeSpotSeekerTask()
{
return $this->source_user_promo_code_spot_seeker_task;
}
/**
* @param PromoCodes $source_user_promo_code_spot_seeker_task
*/
public function setSourceUserPromoCodeSpotSeekerTask(PromoCodes $source_user_promo_code_spot_seeker_task)
{
$this->source_user_promo_code_spot_seeker_task = $source_user_promo_code_spot_seeker_task;
}
/**
* @return PromoCodes
*/
public function getUserPromoCodeSpotOwnerTask()
{
return $this->user_promo_code_spot_owner_task;
}
/**
* @param PromoCodes $user_promo_code_spot_owner_task
*/
public function setUserPromoCodeSpotOwnerTask(PromoCodes $user_promo_code_spot_owner_task)
{
$this->user_promo_code_spot_owner_task = $user_promo_code_spot_owner_task;
}
/**
* @return PromoCodes
*/
public function getSourceUserPromoCodeSpotOwnerTask()
{
return $this->source_user_promo_code_spot_owner_task;
}
/**
* @param PromoCodes $source_user_promo_code_spot_owner_task
*/
public function setSourceUserPromoCodeSpotOwnerTask(PromoCodes $source_user_promo_code_spot_owner_task)
{
$this->source_user_promo_code_spot_owner_task = $source_user_promo_code_spot_owner_task;
}
/**
* @return PromoCodes
*/
public function getUserPromoCodeUserSignUpTask()
{
return $this->user_promo_code_user_sign_up_task;
}
/**
* @param PromoCodes $user_promo_code_user_sign_up_task
*/
public function setUserPromoCodeUserSignUpTask(PromoCodes $user_promo_code_user_sign_up_task)
{
$this->user_promo_code_user_sign_up_task = $user_promo_code_user_sign_up_task;
}
/**
* @return PromoCodes
*/
public function getSourceUserPromoCodeUserSignUpTask()
{
return $this->source_user_promo_code_user_sign_up_task;
}
/**
* @param PromoCodes $source_user_promo_code_user_sign_up_task
*/
public function setSourceUserPromoCodeUserSignUpTask(PromoCodes $source_user_promo_code_user_sign_up_task)
{
$this->source_user_promo_code_user_sign_up_task = $source_user_promo_code_user_sign_up_task;
}
/**
* @return mixed
*/
public function getActive()
{
return $this->active;
}
/**
* @param mixed $active
*/
public function setActive($active)
{
$this->active = $active;
}
/**
* @return mixed
*/
public function getIsSpotSeekerTaskCompleted()
{
return $this->is_spot_seeker_task_completed;
}
/**
* @param mixed $is_spot_seeker_task_completed
*/
public function setIsSpotSeekerTaskCompleted($is_spot_seeker_task_completed)
{
$this->is_spot_seeker_task_completed = $is_spot_seeker_task_completed;
}
/**
* @return mixed
*/
public function getIsSpotOwnerTaskCompleted()
{
return $this->is_spot_owner_task_completed;
}
/**
* @param mixed $is_spot_owner_task_completed
*/
public function setIsSpotOwnerTaskCompleted($is_spot_owner_task_completed)
{
$this->is_spot_owner_task_completed = $is_spot_owner_task_completed;
}
/**
* @return mixed
*/
public function getIsUserSignUpTaskCompleted()
{
return $this->is_user_sign_up_task_completed;
}
/**
* @param mixed $is_user_sign_up_task_completed
*/
public function setIsUserSignUpTaskCompleted($is_user_sign_up_task_completed)
{
$this->is_user_sign_up_task_completed = $is_user_sign_up_task_completed;
}
public function jsonSerialize()
{
return array(
'id' => $this->id,
'user_id' => $this->getUser()->getId(),
'source_user_id' => $this->getSourceUser()->getId(),
'source_user_first_name' => $this->getSourceUser()->getFirstName(),
'source_user_last_name' => $this->getSourceUser()->getLastName(),
'source_user_invite_code' => $this->getSourceUser()->getInviteCode(),
);
}
/**
* @var string $created
*
* @ORM\Column(name="created_at", type="string", nullable=false)
*/
protected $createdAt;
/**
* @var string $updated
*
* @ORM\Column(name="updated_at", type="string", nullable=false)
*/
protected $updatedAt;
public function getCreatedAt()
{
return $this->createdAt;
}
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps()
{
$this->setUpdatedAt(round(microtime(true) * 1000));
if ($this->getCreatedAt() === null) {
$this->setCreatedAt(round(microtime(true) * 1000));
}
}
public function __construct() {
$this->setCreatedAt(round(microtime(true) * 1000));
}
}