mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-30 05:24:28 +02:00
Show parts count on AdminPages of PartsContainingDBElements
This commit is contained in:
parent
082608dbd9
commit
e19cd67b88
10 changed files with 97 additions and 38 deletions
|
@ -52,6 +52,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Entity\Base;
|
||||
|
||||
use App\Entity\Parts\Part;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
|
@ -61,5 +64,23 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
*/
|
||||
abstract class PartsContainingDBElement extends StructuralDBElement
|
||||
{
|
||||
/**
|
||||
* @var Part[]|Collection
|
||||
*/
|
||||
protected $parts;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->parts = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the parts associated with this element.
|
||||
* @return Collection|Part[]
|
||||
*/
|
||||
public function getParts() : Collection
|
||||
{
|
||||
return $this->parts;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue