mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 04:30:08 +02:00
parent
be47680b60
commit
8951940be1
6 changed files with 973 additions and 888 deletions
|
@ -91,7 +91,7 @@ class AttachmentType extends AbstractStructuralDBElement
|
|||
*/
|
||||
public function getAttachmentsForType(): Collection
|
||||
{
|
||||
return $this->attachments;
|
||||
return $this->attachments_with_type;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace App\Entity\PriceInformations;
|
|||
use App\Entity\Attachments\CurrencyAttachment;
|
||||
use App\Entity\Base\AbstractStructuralDBElement;
|
||||
use App\Entity\Parameters\CurrencyParameter;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
@ -103,6 +104,25 @@ class Currency extends AbstractStructuralDBElement
|
|||
*/
|
||||
protected $parameters;
|
||||
|
||||
/** @var Collection<int, Pricedetail>
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\PriceInformations\Pricedetail", mappedBy="currency")
|
||||
*/
|
||||
protected $pricedetails;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->pricedetails = new ArrayCollection();
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getPricedetails(): Collection
|
||||
{
|
||||
return $this->pricedetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the 3 letter ISO code of this currency.
|
||||
*
|
||||
|
|
|
@ -82,7 +82,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
|
|||
/**
|
||||
* @var ?Currency The currency used for the current price information.
|
||||
* If this is null, the global base unit is assumed.
|
||||
* @ORM\ManyToOne(targetEntity="Currency")
|
||||
* @ORM\ManyToOne(targetEntity="Currency", inversedBy="pricedetails")
|
||||
* @ORM\JoinColumn(name="id_currency", referencedColumnName="id", nullable=true)
|
||||
* @Selectable()
|
||||
*/
|
||||
|
|
|
@ -47,6 +47,7 @@ use App\Entity\Base\AbstractStructuralDBElement;
|
|||
use App\Entity\Parameters\GroupParameter;
|
||||
use App\Security\Interfaces\HasPermissionsInterface;
|
||||
use App\Validator\Constraints\ValidPermission;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
@ -102,10 +103,12 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
|
|||
*/
|
||||
protected $parameters;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->permissions = new PermissionsEmbed();
|
||||
$this->users = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -136,4 +139,9 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
|
|||
{
|
||||
return $this->permissions;
|
||||
}
|
||||
|
||||
public function getUsers(): Collection
|
||||
{
|
||||
return $this->users;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue