mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-12 23:56:29 +03:00
250 lines
11 KiB
JSON
250 lines
11 KiB
JSON
{
|
|
"manifests": {
|
|
"sonata-project/media-orm-pack": {
|
|
"manifest": {
|
|
"copy-from-recipe": {
|
|
"config/": "%CONFIG_DIR%/",
|
|
"src/": "%SRC_DIR%/"
|
|
},
|
|
"post-install-output": [
|
|
" * If you are using <info>sonata-project/classification-bundle</>, fix annotations for",
|
|
" <info>App\\Entity\\SonataMediaMedia::$category</>"
|
|
]
|
|
},
|
|
"files": {
|
|
"src/Entity/SonataMediaGallery.php": {
|
|
"contents": [
|
|
"<?php",
|
|
"",
|
|
"declare(strict_types=1);",
|
|
"",
|
|
"namespace App\\Entity;",
|
|
"",
|
|
"use Doctrine\\ORM\\Mapping as ORM;",
|
|
"use JMS\\Serializer\\Annotation as Serializer;",
|
|
"use Sonata\\MediaBundle\\Entity\\BaseGallery;",
|
|
"",
|
|
"/**",
|
|
" * @ORM\\Entity",
|
|
" * @ORM\\Table(name=\"media__gallery\")",
|
|
" * @ORM\\HasLifecycleCallbacks",
|
|
" */",
|
|
"class SonataMediaGallery extends BaseGallery",
|
|
"{",
|
|
" /**",
|
|
" * @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\\SonataMediaGalleryHasMedia\",",
|
|
" * mappedBy=\"gallery\", cascade={\"persist\"}, orphanRemoval=true",
|
|
" * )",
|
|
" * @ORM\\OrderBy({\"position\"=\"ASC\"})",
|
|
" *",
|
|
" * @var SonataMediaGalleryHasMedia[]",
|
|
" */",
|
|
" protected $galleryHasMedias;",
|
|
"",
|
|
" public function getId()",
|
|
" {",
|
|
" return $this->id;",
|
|
" }",
|
|
"",
|
|
" /**",
|
|
" * @ORM\\PrePersist",
|
|
" */",
|
|
" public function prePersist(): void",
|
|
" {",
|
|
" parent::prePersist();",
|
|
" }",
|
|
"",
|
|
" /**",
|
|
" * @ORM\\PreUpdate",
|
|
" */",
|
|
" public function preUpdate(): void",
|
|
" {",
|
|
" parent::preUpdate();",
|
|
" }",
|
|
"}",
|
|
""
|
|
],
|
|
"executable": false
|
|
},
|
|
"src/Entity/SonataMediaMedia.php": {
|
|
"contents": [
|
|
"<?php",
|
|
"",
|
|
"declare(strict_types=1);",
|
|
"",
|
|
"namespace App\\Entity;",
|
|
"",
|
|
"use Doctrine\\ORM\\Mapping as ORM;",
|
|
"use JMS\\Serializer\\Annotation as Serializer;",
|
|
"use Sonata\\MediaBundle\\Entity\\BaseMedia;",
|
|
"",
|
|
"/**",
|
|
" * @ORM\\Entity",
|
|
" * @ORM\\Table(name=\"media__media\")",
|
|
" * @ORM\\HasLifecycleCallbacks",
|
|
" */",
|
|
"class SonataMediaMedia extends BaseMedia",
|
|
"{",
|
|
" /**",
|
|
" * @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\\SonataMediaGalleryHasMedia\",",
|
|
" * mappedBy=\"media\", cascade={\"persist\"}, orphanRemoval=false",
|
|
" * )",
|
|
" *",
|
|
" * @var SonataMediaGalleryHasMedia[]",
|
|
" */",
|
|
" protected $galleryHasMedias;",
|
|
"",
|
|
" /**",
|
|
" * Fix annotations if you use classification-bundle.",
|
|
" *",
|
|
" * // ORM\\ManyToOne(",
|
|
" * targetEntity=\"App\\Entity\\SonataClassificationCategory\",",
|
|
" * cascade={\"persist\"}",
|
|
" * )",
|
|
" * // ORM\\JoinColumn(name=\"category_id\", referencedColumnName=\"id\", onDelete=\"SET NULL\")",
|
|
" *",
|
|
" * @var SonataClassificationCategory",
|
|
" */",
|
|
" protected $category;",
|
|
"",
|
|
" public function getId()",
|
|
" {",
|
|
" return $this->id;",
|
|
" }",
|
|
"",
|
|
" /**",
|
|
" * @ORM\\PrePersist",
|
|
" */",
|
|
" public function prePersist(): void",
|
|
" {",
|
|
" parent::prePersist();",
|
|
" }",
|
|
"",
|
|
" /**",
|
|
" * @ORM\\PreUpdate",
|
|
" */",
|
|
" public function preUpdate(): void",
|
|
" {",
|
|
" parent::preUpdate();",
|
|
" }",
|
|
"}",
|
|
""
|
|
],
|
|
"executable": false
|
|
},
|
|
"src/Entity/SonataMediaGalleryHasMedia.php": {
|
|
"contents": [
|
|
"<?php",
|
|
"",
|
|
"declare(strict_types=1);",
|
|
"",
|
|
"namespace App\\Entity;",
|
|
"",
|
|
"use Doctrine\\ORM\\Mapping as ORM;",
|
|
"use JMS\\Serializer\\Annotation as Serializer;",
|
|
"use Sonata\\MediaBundle\\Entity\\BaseGalleryHasMedia;",
|
|
"",
|
|
"/**",
|
|
" * @ORM\\Entity",
|
|
" * @ORM\\Table(name=\"media__gallery_media\")",
|
|
" * @ORM\\HasLifecycleCallbacks",
|
|
" */",
|
|
"class SonataMediaGalleryHasMedia extends BaseGalleryHasMedia",
|
|
"{",
|
|
" /**",
|
|
" * @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\\SonataMediaMedia\",",
|
|
" * inversedBy=\"galleryHasMedias\", cascade={\"persist\"}",
|
|
" * )",
|
|
" * @ORM\\JoinColumn(name=\"media_id\", referencedColumnName=\"id\", onDelete=\"CASCADE\")",
|
|
" *",
|
|
" * @var SonataMediaMedia",
|
|
" */",
|
|
" protected $media;",
|
|
"",
|
|
" /**",
|
|
" * @ORM\\ManyToOne(",
|
|
" * targetEntity=\"App\\Entity\\SonataMediaGallery\",",
|
|
" * inversedBy=\"galleryHasMedias\", cascade={\"persist\"}",
|
|
" * )",
|
|
" * @ORM\\JoinColumn(name=\"gallery_id\", referencedColumnName=\"id\", onDelete=\"CASCADE\")",
|
|
" *",
|
|
" * @var SonataMediaGallery",
|
|
" */",
|
|
" protected $gallery;",
|
|
"",
|
|
" public function getId()",
|
|
" {",
|
|
" return $this->id;",
|
|
" }",
|
|
"",
|
|
" /**",
|
|
" * @ORM\\PrePersist",
|
|
" */",
|
|
" public function prePersist(): void",
|
|
" {",
|
|
" parent::prePersist();",
|
|
" }",
|
|
"",
|
|
" /**",
|
|
" * @ORM\\PreUpdate",
|
|
" */",
|
|
" public function preUpdate(): void",
|
|
" {",
|
|
" parent::preUpdate();",
|
|
" }",
|
|
"}",
|
|
""
|
|
],
|
|
"executable": false
|
|
},
|
|
"config/packages/sonata_media_orm.yaml": {
|
|
"contents": [
|
|
"sonata_media:",
|
|
" class:",
|
|
" media: App\\Entity\\SonataMediaMedia",
|
|
" gallery: App\\Entity\\SonataMediaGallery",
|
|
" gallery_has_media: App\\Entity\\SonataMediaGalleryHasMedia",
|
|
" category: App\\Entity\\SonataClassificationCategory",
|
|
" db_driver: doctrine_orm",
|
|
""
|
|
],
|
|
"executable": false
|
|
}
|
|
},
|
|
"ref": "5961ad63ce003f2735f17026d612f7a87954f5c8"
|
|
}
|
|
}
|
|
} |