Skip to content

Instantly share code, notes, and snippets.

@HongKilDong
Created December 27, 2021 09:01
Show Gist options
  • Save HongKilDong/44e06af2dd00c056a03d8a0a94c3daa3 to your computer and use it in GitHub Desktop.
Save HongKilDong/44e06af2dd00c056a03d8a0a94c3daa3 to your computer and use it in GitHub Desktop.
<?php
declare(strict_types=1);
namespace App\Entity\Blog;
use Doctrine\ORM\Mapping as ORM;
/**
* App\Entity\Blog\Article
*
* @ORM\Entity
* @ORM\Table(name="blog_article")
*/
class Article extends \Odiseo\SyliusBlogPlugin\Entity\Article
{
/**
* @ORM\Column(name="cover_image_id")
* @ORM\OneToOne(targetEntity=ArticleCoverImage::class, inversedBy="owner", cascade={"all"})
* @ORM\JoinColumn(name="cover_image_id", nullable=true)
*/
private $coverImage;
public function getCoverImage(): ?ArticleCoverImage
{
return $this->coverImage;
}
public function setCoverImage(ArticleCoverImage $coverImage): self
{
$this->coverImage = $coverImage;
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment