src/Entity/Action.php line 21
<?php
namespace App\Entity;
use App\Repository\ActionRepository;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Action\NotFoundAction;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\ApiResource;
use Symfony\Component\Serializer\Annotation\MaxDepth;
/**
* Action entity
*/
#[ApiResource(
normalizationContext: ['enable_max_depth'=>true],
)]
#[ORM\Entity(repositoryClass: ActionRepository::class)]
class Action
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
/**
* @var string $name
*/
#[ORM\Column(length: 32)]
private ?string $name = null;
/**
* Getter for the entity's id property
*
* @return int The id property
*/
public function getId(): ?int
{
return $this->id;
}
/**
* Getter for the entity's name property
*
* @return string The name property
*/
public function getName(): ?string
{
return $this->name;
}
/**
* Setter for the entity's name property
*
* @param $name The property's new value
* @return self
*/
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* Converts the entity to a string. Used to show a string that represents the entity in form fields
*
* @return string The Action's name
*/
public function __toString() // Used to show the action in the relation with Permission
{
return $this->name;
}
}