Last active
April 28, 2018 16:07
-
-
Save covex-nn/e9cbcebec05a4e1558460b8f7160637e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use JMS\Serializer\Annotation as Serializer; | |
use Sonata\PageBundle\Entity\BaseBlock; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="page__block") | |
* @ORM\HasLifecycleCallbacks | |
*/ | |
class SonataPageBlock extends BaseBlock | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue(strategy="AUTO") | |
* // Serializer\Groups(groups={"sonata_api_read","sonata_api_write","sonata_search"}) | |
* | |
* @var int | |
*/ | |
protected $id; | |
/** | |
* @ORM\OneToMany( | |
* targetEntity="App\Entity\SonataPageBlock", | |
* mappedBy="parent", cascade={"remove", "persist"}, orphanRemoval=true | |
* ) | |
* @ORM\OrderBy({"position"="ASC"}) | |
* | |
* @var SonataPageBlock[] | |
*/ | |
protected $children; | |
/** | |
* @ORM\ManyToOne( | |
* targetEntity="App\Entity\SonataPageBlock", | |
* inversedBy="children" | |
* ) | |
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE") | |
* | |
* @var SonataPageBlock | |
*/ | |
protected $parent; | |
/** | |
* @ORM\ManyToOne( | |
* targetEntity="App\Entity\SonataPagePage", | |
* inversedBy="blocks", cascade={"persist"} | |
* ) | |
* @ORM\JoinColumn(name="page_id", referencedColumnName="id", onDelete="CASCADE") | |
* | |
* @var SonataPagePage | |
*/ | |
protected $page; | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* @ORM\PrePersist | |
*/ | |
public function prePersist(): void | |
{ | |
parent::prePersist(); | |
} | |
/** | |
* @ORM\PreUpdate | |
*/ | |
public function preUpdate(): void | |
{ | |
parent::preUpdate(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use JMS\Serializer\Annotation as Serializer; | |
use Sonata\PageBundle\Entity\BasePage; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="page__page") | |
* @ORM\HasLifecycleCallbacks | |
*/ | |
class SonataPagePage extends BasePage | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue(strategy="AUTO") | |
* // Serializer\Groups(groups={"sonata_api_read","sonata_api_write","sonata_search"}) | |
* | |
* @var int | |
*/ | |
protected $id; | |
/** | |
* @ORM\OneToMany( | |
* targetEntity="App\Entity\SonataPagePage", | |
* mappedBy="parent", cascade={"persist"}, orphanRemoval=false | |
* ) | |
* @ORM\OrderBy({"position"="ASC"}) | |
* | |
* @var SonataPagePage[] | |
*/ | |
protected $children; | |
/** | |
* @ORM\OneToMany( | |
* targetEntity="App\Entity\SonataPageBlock", | |
* mappedBy="page", cascade={"remove", "persist", "refresh", "merge", "detach"}, orphanRemoval=false | |
* ) | |
* @ORM\OrderBy({"position"="ASC"}) | |
* | |
* @var SonataPageBlock[] | |
*/ | |
protected $blocks; | |
/** | |
* @ORM\ManyToOne( | |
* targetEntity="App\Entity\SonataPageSite", | |
* cascade={"persist"} | |
* ) | |
* @ORM\JoinColumn(name="site_id", referencedColumnName="id", onDelete="CASCADE") | |
* | |
* @var SonataPageSite | |
*/ | |
protected $site; | |
/** | |
* @ORM\ManyToOne( | |
* targetEntity="App\Entity\SonataPagePage", | |
* inversedBy="children", cascade={"persist"} | |
* ) | |
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE") | |
* | |
* @var SonataPagePage | |
*/ | |
protected $parent; | |
/** | |
* @ORM\OneToMany( | |
* targetEntity="App\Entity\SonataPagePage", | |
* mappedBy="target", orphanRemoval=false | |
* ) | |
* | |
* @var SonataPagePage[] | |
*/ | |
protected $sources; | |
/** | |
* @ORM\ManyToOne( | |
* targetEntity="App\Entity\SonataPagePage", | |
* inversedBy="sources", cascade={"persist"} | |
* ) | |
* @ORM\JoinColumn(name="target_id", referencedColumnName="id", onDelete="CASCADE") | |
* | |
* @var SonataPagePage | |
*/ | |
protected $target; | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* @ORM\PrePersist | |
*/ | |
public function prePersist(): void | |
{ | |
parent::prePersist(); | |
} | |
/** | |
* @ORM\PreUpdate | |
*/ | |
public function preUpdate(): void | |
{ | |
parent::preUpdate(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use JMS\Serializer\Annotation as Serializer; | |
use Sonata\PageBundle\Entity\BaseSite; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="page__site") | |
* @ORM\HasLifecycleCallbacks | |
*/ | |
class SonataPageSite extends BaseSite | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue(strategy="AUTO") | |
* \\ Serializer\Groups(groups={"sonata_api_read","sonata_api_write","sonata_search"}) | |
* | |
* @var int | |
*/ | |
protected $id; | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* @ORM\PrePersist | |
*/ | |
public function prePersist(): void | |
{ | |
parent::prePersist(); | |
} | |
/** | |
* @ORM\PreUpdate | |
*/ | |
public function preUpdate(): void | |
{ | |
parent::preUpdate(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use JMS\Serializer\Annotation as Serializer; | |
use Sonata\PageBundle\Entity\BaseSnapshot; | |
/** | |
* @ORM\Entity | |
* @ORM\Table(name="page__snapshot", indexes={ | |
* @ORM\Index( | |
* name="idx_snapshot_dates_enabled", columns={"publication_date_start", "publication_date_end","enabled" | |
* }) | |
* }) | |
*/ | |
class SonataPageSnapshot extends BaseSnapshot | |
{ | |
/** | |
* @ORM\Id | |
* @ORM\Column(type="integer") | |
* @ORM\GeneratedValue(strategy="AUTO") | |
* // Serializer\Groups(groups={"sonata_api_read","sonata_api_write","sonata_search"}) | |
* | |
* @var int | |
*/ | |
protected $id; | |
/** | |
* @ORM\ManyToOne( | |
* targetEntity="App\Entity\SonataPageSite", | |
* cascade={"persist"} | |
* ) | |
* @ORM\JoinColumn(name="site_id", referencedColumnName="id", onDelete="CASCADE") | |
* | |
* @var SonataPageSite | |
*/ | |
protected $site; | |
/** | |
* @ORM\ManyToOne( | |
* targetEntity="App\Entity\SonataPagePage", | |
* cascade={"persist"} | |
* ) | |
* @ORM\JoinColumn(name="page_id", referencedColumnName="id", onDelete="CASCADE") | |
* | |
* @var SonataPagePage | |
*/ | |
protected $page; | |
public function getId() | |
{ | |
return $this->id; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment