Commit cedf001c authored by SpinShare's avatar SpinShare

rename badge to card

parent a47b625f
......@@ -7,9 +7,9 @@ use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\BadgeRepository")
* @ORM\Entity(repositoryClass="App\Repository\CardRepository")
*/
class Badge
class Card
{
/**
* @ORM\Id()
......@@ -34,7 +34,7 @@ class Badge
private $icon;
/**
* @ORM\OneToMany(targetEntity="App\Entity\UserBadge", mappedBy="badge")
* @ORM\OneToMany(targetEntity="App\Entity\UserCard", mappedBy="card")
*/
private $users;
......@@ -85,30 +85,30 @@ class Badge
}
/**
* @return Collection|UserBadge[]
* @return Collection|UserCard[]
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(UserBadge $user): self
public function addUser(UserCard $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->setBadge($this);
$user->setCard($this);
}
return $this;
}
public function removeUser(UserBadge $user): self
public function removeUser(UserCard $user): self
{
if ($this->users->contains($user)) {
$this->users->removeElement($user);
// set the owning side to null (unless already changed)
if ($user->getBadge() === $this) {
$user->setBadge(null);
if ($user->getCard() === $this) {
$user->setCard(null);
}
}
......
......@@ -5,9 +5,9 @@ namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\UserBadgeRepository")
* @ORM\Entity(repositoryClass="App\Repository\UserCardRepository")
*/
class UserBadge
class UserCard
{
/**
* @ORM\Id()
......@@ -17,10 +17,10 @@ class UserBadge
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Badge", inversedBy="users")
* @ORM\ManyToOne(targetEntity="App\Entity\Card", inversedBy="users")
* @ORM\JoinColumn(nullable=false)
*/
private $badge;
private $card;
/**
* @ORM\Column(type="date")
......@@ -32,14 +32,14 @@ class UserBadge
return $this->id;
}
public function getBadge(): ?Badge
public function getCard(): ?Card
{
return $this->badge;
return $this->card;
}
public function setBadge(?Badge $badge): self
public function setCard(?Card $card): self
{
$this->badge = $badge;
$this->card = $card;
return $this;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment