2018-04-04 16:25:25 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace AppBundle\Entity;
|
|
|
|
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
use FOS\UserBundle\Model\User as BaseUser;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* User
|
|
|
|
*
|
|
|
|
* @ORM\Table(name="custom_user")
|
|
|
|
* @ORM\Entity(repositoryClass="AppBundle\Repository\UserRepository")
|
|
|
|
*/
|
|
|
|
class User extends BaseUser {
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*
|
|
|
|
* @ORM\Column(name="id", type="integer")
|
|
|
|
* @ORM\Id
|
|
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
|
|
*/
|
|
|
|
protected $id;
|
|
|
|
|
2018-04-25 14:47:31 +02:00
|
|
|
/**
|
|
|
|
* @ORM\Column(name="twitter_id", type="string", length=255, nullable=true)
|
|
|
|
*/
|
|
|
|
private $twitterId;
|
2018-04-25 17:32:44 +02:00
|
|
|
private $twitterAccessToken;
|
2018-04-25 14:47:31 +02:00
|
|
|
/**
|
|
|
|
* @ORM\Column(name="disqus_id", type="string", length=255, nullable=true)
|
|
|
|
*/
|
|
|
|
private $disqusId;
|
2018-04-25 17:32:44 +02:00
|
|
|
private $disqusAccessToken;
|
2018-04-04 17:42:27 +02:00
|
|
|
/**
|
|
|
|
* @ORM\Column(name="google_id", type="string", length=255, nullable=true)
|
|
|
|
*/
|
|
|
|
private $googleId;
|
|
|
|
|
|
|
|
private $googleAccessToken;
|
2018-08-27 14:58:45 +02:00
|
|
|
/**
|
|
|
|
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\ProductCategory", inversedBy="users")
|
|
|
|
*/
|
|
|
|
private $categories;
|
2018-04-05 15:05:04 +02:00
|
|
|
/**
|
2018-04-05 16:40:40 +02:00
|
|
|
* templates products
|
2018-04-05 15:05:04 +02:00
|
|
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Product", mappedBy="user")
|
|
|
|
*/
|
|
|
|
private $products;
|
2018-04-05 16:40:40 +02:00
|
|
|
|
2018-04-05 15:05:04 +02:00
|
|
|
/**
|
2018-04-05 16:40:40 +02:00
|
|
|
* variabilised products sold
|
2018-04-05 15:05:04 +02:00
|
|
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\ProductSold", mappedBy="user")
|
|
|
|
*/
|
|
|
|
private $productsSold;
|
2018-04-17 15:41:00 +02:00
|
|
|
/**
|
|
|
|
* variabilised products sold
|
|
|
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Festival", mappedBy="user")
|
|
|
|
*/
|
|
|
|
private $festivals;
|
2018-08-27 14:58:45 +02:00
|
|
|
/**
|
|
|
|
* series of festivals
|
|
|
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\SerieFestival", mappedBy="user")
|
|
|
|
*/
|
|
|
|
private $seriesFestivals;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* current festival we are recording sellings for
|
|
|
|
* @ORM\OneToOne(targetEntity="AppBundle\Entity\Festival")
|
|
|
|
*/
|
|
|
|
private $activeFestival;
|
|
|
|
|
|
|
|
//expenses previsionnel configs
|
|
|
|
/**
|
2018-08-27 15:20:01 +02:00
|
|
|
* @ORM\Column(name="averageMonthlyEarnings", type="float", nullable=true)
|
2018-08-27 14:58:45 +02:00
|
|
|
*/
|
2018-08-27 15:20:01 +02:00
|
|
|
private $averageMonthlyEarnings;
|
|
|
|
|
2018-08-27 14:58:45 +02:00
|
|
|
/**
|
|
|
|
* @ORM\Column(name="disponibility", type="float", nullable=true)
|
|
|
|
*/
|
|
|
|
private $disponibility;
|
2018-08-22 16:42:21 +02:00
|
|
|
/**
|
|
|
|
* variabilised products sold
|
|
|
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\ExpenseKind", mappedBy="user")
|
|
|
|
*/
|
|
|
|
private $expenses;
|
2018-04-05 16:40:40 +02:00
|
|
|
|
2018-08-27 14:58:45 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2018-08-27 15:20:01 +02:00
|
|
|
public function getAverageMonthlyEarnings()
|
2018-08-27 14:58:45 +02:00
|
|
|
{
|
2018-08-27 15:20:01 +02:00
|
|
|
return $this->averageMonthlyEarnings;
|
2018-08-27 14:58:45 +02:00
|
|
|
}
|
2018-04-05 16:40:40 +02:00
|
|
|
|
2018-08-27 14:58:45 +02:00
|
|
|
/**
|
2018-08-27 15:20:01 +02:00
|
|
|
* @param mixed $averageMonthlyEarnings
|
2018-08-27 14:58:45 +02:00
|
|
|
*/
|
2018-08-27 15:20:01 +02:00
|
|
|
public function setAverageMonthlyEarnings($averageMonthlyEarnings)
|
2018-08-27 14:58:45 +02:00
|
|
|
{
|
2018-08-27 15:20:01 +02:00
|
|
|
$this->averageMonthlyEarnings = $averageMonthlyEarnings;
|
2018-08-27 14:58:45 +02:00
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getDisponibility()
|
|
|
|
{
|
|
|
|
return $this->disponibility;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $disponibility
|
|
|
|
*/
|
|
|
|
public function setDisponibility($disponibility)
|
|
|
|
{
|
|
|
|
$this->disponibility = $disponibility;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getSeriesFestivals()
|
|
|
|
{
|
|
|
|
return $this->seriesFestivals;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $seriesFestivals
|
|
|
|
*/
|
|
|
|
public function setSeriesFestivals($seriesFestivals)
|
|
|
|
{
|
|
|
|
$this->seriesFestivals = $seriesFestivals;
|
|
|
|
}
|
2018-08-23 18:12:32 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getExpenses()
|
|
|
|
{
|
|
|
|
return $this->expenses;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $expenses
|
|
|
|
*/
|
|
|
|
public function setExpenses($expenses)
|
|
|
|
{
|
|
|
|
$this->expenses = $expenses;
|
|
|
|
}
|
|
|
|
|
2018-04-05 16:40:40 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getProductsSold() {
|
|
|
|
return $this->productsSold;
|
|
|
|
}
|
|
|
|
|
2018-04-10 10:16:23 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function addProductsSold( $product ) {
|
|
|
|
return $this->productsSold[] = $product;
|
|
|
|
}
|
|
|
|
|
2018-04-05 16:40:40 +02:00
|
|
|
/**
|
|
|
|
* @param mixed $productsSold
|
|
|
|
*/
|
|
|
|
public function setProductsSold( $productsSold ) {
|
|
|
|
$this->productsSold = $productsSold;
|
|
|
|
}
|
|
|
|
|
2018-04-05 15:05:04 +02:00
|
|
|
/**
|
|
|
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\SellRecord", mappedBy="user")
|
|
|
|
*/
|
|
|
|
private $sellRecords;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getSellRecords() {
|
|
|
|
return $this->sellRecords;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $sellRecords
|
|
|
|
*/
|
|
|
|
public function setSellRecords( $sellRecords ) {
|
|
|
|
$this->sellRecords = $sellRecords;
|
|
|
|
}
|
|
|
|
|
2018-04-10 10:16:23 +02:00
|
|
|
/**
|
|
|
|
* @param mixed $sellRecords
|
|
|
|
*/
|
|
|
|
public function addSellRecords( $sellRecords ) {
|
|
|
|
$this->sellRecords[] = $sellRecords;
|
|
|
|
}
|
|
|
|
|
2018-04-05 15:05:04 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getGoogleAccessToken() {
|
|
|
|
return $this->googleAccessToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $googleAccessToken
|
|
|
|
*/
|
|
|
|
public function setGoogleAccessToken( $googleAccessToken ) {
|
|
|
|
$this->googleAccessToken = $googleAccessToken;
|
|
|
|
}
|
|
|
|
|
2018-04-25 17:32:44 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getDisqusAccessToken() {
|
|
|
|
return $this->disqusAccessToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $disqusAccessToken
|
|
|
|
*/
|
|
|
|
public function setDisqusAccessToken( $disqusAccessToken ) {
|
|
|
|
$this->disqusAccessToken = $disqusAccessToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getTwitterAccessToken() {
|
|
|
|
return $this->twitterAccessToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $twitterAccessToken
|
|
|
|
*/
|
|
|
|
public function setTwitterAccessToken( $TwitterAccessToken ) {
|
|
|
|
$this->twitterAccessToken = $TwitterAccessToken;
|
|
|
|
}
|
|
|
|
|
2018-04-05 15:05:04 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getProducts() {
|
|
|
|
return $this->products;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $products
|
|
|
|
*/
|
|
|
|
public function setProducts( $products ) {
|
|
|
|
$this->products = $products;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getCategories() {
|
|
|
|
return $this->categories;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $categories
|
|
|
|
*/
|
|
|
|
public function setCategories( $categories ) {
|
|
|
|
$this->categories = $categories;
|
|
|
|
}
|
|
|
|
|
2018-04-04 16:25:25 +02:00
|
|
|
/**
|
|
|
|
* Get id
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getId() {
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
2018-04-05 15:05:04 +02:00
|
|
|
/**
|
|
|
|
* Set googleId
|
|
|
|
*
|
|
|
|
* @param string $googleId
|
|
|
|
*
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function setGoogleId( $googleId ) {
|
|
|
|
$this->googleId = $googleId;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get googleId
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getGoogleId() {
|
|
|
|
return $this->googleId;
|
|
|
|
}
|
2018-04-17 12:10:21 +02:00
|
|
|
|
2018-04-17 15:41:00 +02:00
|
|
|
/**
|
|
|
|
* Add product
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\Product $product
|
|
|
|
*
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function addProduct( \AppBundle\Entity\Product $product ) {
|
|
|
|
$this->products[] = $product;
|
2018-04-17 12:10:21 +02:00
|
|
|
|
2018-04-17 15:41:00 +02:00
|
|
|
return $this;
|
|
|
|
}
|
2018-04-17 12:10:21 +02:00
|
|
|
|
2018-04-17 15:41:00 +02:00
|
|
|
/**
|
|
|
|
* Remove product
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\Product $product
|
|
|
|
*/
|
|
|
|
public function removeProduct( \AppBundle\Entity\Product $product ) {
|
|
|
|
$this->products->removeElement( $product );
|
|
|
|
}
|
2018-04-17 12:10:21 +02:00
|
|
|
|
2018-04-17 15:41:00 +02:00
|
|
|
/**
|
|
|
|
* Remove productsSold
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\ProductSold $productsSold
|
|
|
|
*/
|
|
|
|
public function removeProductsSold( \AppBundle\Entity\ProductSold $productsSold ) {
|
|
|
|
$this->productsSold->removeElement( $productsSold );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add category
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\ProductCategory $category
|
|
|
|
*
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function addCategory( \AppBundle\Entity\ProductCategory $category ) {
|
|
|
|
$this->categories[] = $category;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove category
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\ProductCategory $category
|
|
|
|
*/
|
|
|
|
public function removeCategory( \AppBundle\Entity\ProductCategory $category ) {
|
|
|
|
$this->categories->removeElement( $category );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add sellRecord
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\SellRecord $sellRecord
|
|
|
|
*
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function addSellRecord( \AppBundle\Entity\SellRecord $sellRecord ) {
|
|
|
|
$this->sellRecords[] = $sellRecord;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove sellRecord
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\SellRecord $sellRecord
|
|
|
|
*/
|
|
|
|
public function removeSellRecord( \AppBundle\Entity\SellRecord $sellRecord ) {
|
|
|
|
$this->sellRecords->removeElement( $sellRecord );
|
|
|
|
}
|
2018-04-17 12:10:21 +02:00
|
|
|
|
2018-04-17 16:15:24 +02:00
|
|
|
/**
|
|
|
|
* Add festival.
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\Festival $festival
|
|
|
|
*
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function addFestival( \AppBundle\Entity\Festival $festival ) {
|
|
|
|
$this->festivals[] = $festival;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove festival.
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\Festival $festival
|
|
|
|
*
|
|
|
|
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
|
|
|
|
*/
|
|
|
|
public function removeFestival( \AppBundle\Entity\Festival $festival ) {
|
|
|
|
return $this->festivals->removeElement( $festival );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get festivals.
|
|
|
|
*
|
|
|
|
* @return \Doctrine\Common\Collections\Collection
|
|
|
|
*/
|
|
|
|
public function getFestivals() {
|
|
|
|
return $this->festivals;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set activeFestival.
|
|
|
|
*
|
|
|
|
* @param \AppBundle\Entity\Festival|null $activeFestival
|
|
|
|
*
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function setActiveFestival( \AppBundle\Entity\Festival $activeFestival = null ) {
|
|
|
|
$this->activeFestival = $activeFestival;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get activeFestival.
|
|
|
|
*
|
|
|
|
* @return \AppBundle\Entity\Festival|null
|
|
|
|
*/
|
|
|
|
public function getActiveFestival() {
|
|
|
|
return $this->activeFestival;
|
|
|
|
}
|
2018-04-25 14:47:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set twitterId.
|
|
|
|
*
|
|
|
|
* @param string|null $twitterId
|
|
|
|
*
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function setTwitterId( $twitterId = null ) {
|
|
|
|
$this->twitterId = $twitterId;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get twitterId.
|
|
|
|
*
|
|
|
|
* @return string|null
|
|
|
|
*/
|
|
|
|
public function getTwitterId() {
|
|
|
|
return $this->twitterId;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set disqusId.
|
|
|
|
*
|
|
|
|
* @param string|null $disqusId
|
|
|
|
*
|
|
|
|
* @return User
|
|
|
|
*/
|
|
|
|
public function setDisqusId( $disqusId = null ) {
|
|
|
|
$this->disqusId = $disqusId;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get disqusId.
|
|
|
|
*
|
|
|
|
* @return string|null
|
|
|
|
*/
|
|
|
|
public function getDisqusId() {
|
|
|
|
return $this->disqusId;
|
|
|
|
}
|
2018-04-04 17:42:27 +02:00
|
|
|
}
|