Rename offering to offer
This commit is contained in:
parent
a7b4bf09e4
commit
f54f663fb0
12 changed files with 90 additions and 59 deletions
|
@ -51,9 +51,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
private $username;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Offering::class, mappedBy="byUser", orphanRemoval=true)
|
||||
* @ORM\OneToMany(targetEntity=Offer::class, mappedBy="byUser", orphanRemoval=true)
|
||||
*/
|
||||
private $offerings;
|
||||
private $offers;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity=Wish::class, mappedBy="byUser")
|
||||
|
@ -72,7 +72,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
$this->offerings = new ArrayCollection();
|
||||
$this->offers = new ArrayCollection();
|
||||
$this->wishes = new ArrayCollection();
|
||||
}
|
||||
|
||||
|
@ -185,29 +185,29 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Collection|Offering[]
|
||||
* @return Collection|Offer[]
|
||||
*/
|
||||
public function getOfferings(): Collection
|
||||
public function getOffers(): Collection
|
||||
{
|
||||
return $this->offerings;
|
||||
return $this->offers;
|
||||
}
|
||||
|
||||
public function addOffering(Offering $offering): self
|
||||
public function addOffer(Offer $offer): self
|
||||
{
|
||||
if (!$this->offerings->contains($offering)) {
|
||||
$this->offerings[] = $offering;
|
||||
$offering->setByUser($this);
|
||||
if (!$this->offers->contains($offer)) {
|
||||
$this->offers[] = $offer;
|
||||
$offer->setByUser($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeOffering(Offering $offering): self
|
||||
public function removeOffer(Offer $offer): self
|
||||
{
|
||||
if ($this->offerings->removeElement($offering)) {
|
||||
if ($this->offers->removeElement($offer)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($offering->getByUser() === $this) {
|
||||
$offering->setByUser(null);
|
||||
if ($offer->getByUser() === $this) {
|
||||
$offer->setByUser(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue