You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
1.7 KiB
85 lines
1.7 KiB
<?php
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\CoreBundle\Entity;
|
|
|
|
use ApiPlatform\Core\Annotation\ApiResource;
|
|
use Chamilo\CourseBundle\Traits\PersonalResourceTrait;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Gedmo\Timestampable\Traits\TimestampableEntity;
|
|
use Symfony\Component\Serializer\Annotation\Groups;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
/**
|
|
* Illustration.
|
|
*
|
|
* @ApiResource(
|
|
* normalizationContext={"groups"={"illustration:read"}}
|
|
* )
|
|
* @ORM\Table(name="illustration")
|
|
* @ORM\Entity
|
|
*/
|
|
class Illustration extends AbstractResource implements ResourceInterface
|
|
{
|
|
use PersonalResourceTrait;
|
|
use TimestampableEntity;
|
|
|
|
/**
|
|
* @var int
|
|
*
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
protected $id;
|
|
|
|
/**
|
|
* @Assert\NotBlank()
|
|
* @Groups({"illustration:read"})
|
|
* @ORM\Column(name="name", type="string", length=255, nullable=false)
|
|
*/
|
|
protected string $name;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->name = 'illustration';
|
|
}
|
|
|
|
public function __toString(): string
|
|
{
|
|
return $this->getName();
|
|
}
|
|
|
|
public function getId(): int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getName(): string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
public function setName(string $name): self
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getResourceIdentifier(): int
|
|
{
|
|
return $this->getId();
|
|
}
|
|
|
|
public function getResourceName(): string
|
|
{
|
|
return $this->getName();
|
|
}
|
|
|
|
public function setResourceName(string $name): self
|
|
{
|
|
return $this->setName($name);
|
|
}
|
|
}
|
|
|