<?php
namespace App\Entity\Article;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiProperty;
use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\Uuid;
/**
* Class Block
* @ApiResource()
* @ORM\Entity()
* @ORM\HasLifecycleCallbacks()
*/
class Block
{
/**
* @ORM\Id()
* @ORM\Column(type="guid")
* @ApiProperty(iri="https://schema.org/identifier", identifier=true)
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Article\Article", inversedBy="blocks")
* @ORM\JoinColumn(name="articleId", referencedColumnName="id", onDelete="SET NULL")
**/
protected $article;
public function __construct()
{
$this->id = Uuid::uuid4();
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
}