61 lines
1.1 KiB
PHP
61 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\ResourceRepository;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* @ORM\Entity(repositoryClass=ResourceRepository::class)
|
|
*/
|
|
class Resource
|
|
{
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue
|
|
* @ORM\Column(type="integer")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity=ResourceType::class, inversedBy="Resources")
|
|
* @ORM\JoinColumn(nullable=false)
|
|
*/
|
|
private $type;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity=Consumer::class, inversedBy="resources")
|
|
* @ORM\JoinColumn(nullable=false)
|
|
*/
|
|
private $owner;
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getType(): ?ResourceType
|
|
{
|
|
return $this->type;
|
|
}
|
|
|
|
public function setType(?ResourceType $type): self
|
|
{
|
|
$this->type = $type;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getOwner(): ?Consumer
|
|
{
|
|
return $this->owner;
|
|
}
|
|
|
|
public function setOwner(?Consumer $owner): self
|
|
{
|
|
$this->owner = $owner;
|
|
|
|
return $this;
|
|
}
|
|
}
|