forked from wallabag/wallabag
remove old implementation for login/register/recover
This commit is contained in:
committed by
Jeremy Benoist
parent
772d8c4b93
commit
1210dae105
@ -72,14 +72,14 @@ class Config
|
||||
private $rssLimit;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="User", inversedBy="config")
|
||||
* @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/*
|
||||
* @param User $user
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
public function __construct(Wallabag\UserBundle\Entity\User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
@ -169,11 +169,11 @@ class Config
|
||||
/**
|
||||
* Set user.
|
||||
*
|
||||
* @param \Wallabag\CoreBundle\Entity\User $user
|
||||
* @param User $user
|
||||
*
|
||||
* @return Config
|
||||
*/
|
||||
public function setUser(\Wallabag\CoreBundle\Entity\User $user = null)
|
||||
public function setUser(User $user = null)
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
@ -183,7 +183,7 @@ class Config
|
||||
/**
|
||||
* Get user.
|
||||
*
|
||||
* @return \Wallabag\CoreBundle\Entity\User
|
||||
* @return User
|
||||
*/
|
||||
public function getUser()
|
||||
{
|
||||
|
||||
@ -7,6 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Hateoas\Configuration\Annotation as Hateoas;
|
||||
use JMS\Serializer\Annotation\XmlRoot;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* Entry.
|
||||
@ -129,7 +130,7 @@ class Entry
|
||||
private $isPublic;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="User", inversedBy="entries")
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="entries")
|
||||
*/
|
||||
private $user;
|
||||
|
||||
@ -142,7 +143,7 @@ class Entry
|
||||
/*
|
||||
* @param User $user
|
||||
*/
|
||||
public function __construct(User $user)
|
||||
public function __construct(Wallabag\UserBundle\Entity\User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->tags = new ArrayCollection();
|
||||
|
||||
@ -42,7 +42,7 @@ class Tag
|
||||
private $entries;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="User", inversedBy="tags")
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="tags")
|
||||
*/
|
||||
private $user;
|
||||
|
||||
|
||||
@ -1,201 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use JMS\Serializer\Annotation\ExclusionPolicy;
|
||||
use JMS\Serializer\Annotation\Expose;
|
||||
use FOS\UserBundle\Model\User as BaseUser;
|
||||
|
||||
/**
|
||||
* User.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\UserRepository")
|
||||
* @ORM\Table
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @ExclusionPolicy("all")
|
||||
*
|
||||
* @UniqueEntity("email")
|
||||
* @UniqueEntity("username")
|
||||
*/
|
||||
class User extends BaseUser
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @Expose
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="name", type="text", nullable=true)
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @var date
|
||||
*
|
||||
* @ORM\Column(name="created_at", type="datetime")
|
||||
*/
|
||||
protected $createdAt;
|
||||
|
||||
/**
|
||||
* @var date
|
||||
*
|
||||
* @ORM\Column(name="updated_at", type="datetime")
|
||||
*/
|
||||
protected $updatedAt;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Entry", mappedBy="user", cascade={"remove"})
|
||||
*/
|
||||
protected $entries;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="Config", mappedBy="user")
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Tag", mappedBy="user", cascade={"remove"})
|
||||
*/
|
||||
protected $tags;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->entries = new ArrayCollection();
|
||||
$this->tags = new ArrayCollection();
|
||||
$this->roles = array('ROLE_USER');
|
||||
}
|
||||
|
||||
/**
|
||||
* @ORM\PrePersist
|
||||
* @ORM\PreUpdate
|
||||
*/
|
||||
public function timestamps()
|
||||
{
|
||||
if (is_null($this->createdAt)) {
|
||||
$this->createdAt = new \DateTime();
|
||||
}
|
||||
|
||||
$this->updatedAt = new \DateTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set name.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCreatedAt()
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUpdatedAt()
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entry $entry
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function addEntry(Entry $entry)
|
||||
{
|
||||
$this->entries[] = $entry;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ArrayCollection<Entry>
|
||||
*/
|
||||
public function getEntries()
|
||||
{
|
||||
return $this->entries;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entry $entry
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function addTag(Tag $tag)
|
||||
{
|
||||
$this->tags[] = $tag;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ArrayCollection<Tag>
|
||||
*/
|
||||
public function getTags()
|
||||
{
|
||||
return $this->tags;
|
||||
}
|
||||
|
||||
public function isEqualTo(UserInterface $user)
|
||||
{
|
||||
return $this->username === $user->getUsername();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set config.
|
||||
*
|
||||
* @param \Wallabag\CoreBundle\Entity\Config $config
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function setConfig(\Wallabag\CoreBundle\Entity\Config $config = null)
|
||||
{
|
||||
$this->config = $config;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get config.
|
||||
*
|
||||
* @return \Wallabag\CoreBundle\Entity\Config
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
return $this->config;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user