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-04 17:42:27 +02:00
|
|
|
/**
|
|
|
|
* @ORM\Column(name="google_id", type="string", length=255, nullable=true)
|
|
|
|
*/
|
|
|
|
private $googleId;
|
|
|
|
|
|
|
|
private $googleAccessToken;
|
2018-04-04 16:25:25 +02:00
|
|
|
|
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-05 16:40:40 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\ProductCategory", inversedBy="users")
|
|
|
|
*/
|
|
|
|
private $categories;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getProductsSold() {
|
|
|
|
return $this->productsSold;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getGoogleAccessToken() {
|
|
|
|
return $this->googleAccessToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $googleAccessToken
|
|
|
|
*/
|
|
|
|
public function setGoogleAccessToken( $googleAccessToken ) {
|
|
|
|
$this->googleAccessToken = $googleAccessToken;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @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-04 17:42:27 +02:00
|
|
|
}
|