Skip to content

Commit fc7113e

Browse files
committed
Change SonataPageBundle entities
1 parent a9eb760 commit fc7113e

File tree

9 files changed

+173
-2
lines changed

9 files changed

+173
-2
lines changed

sonata-project/page-bundle/4.0/post-install.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
* Your Page is almost ready:
2-
1. Generate a migration for Sonata Page Database <info>php bin/console doctrine:migrations:diff</info>
2+
1. Generate a migration for Sonata Page Database <info>bin/console doctrine:migrations:diff</info>
33
<comment>
44
If you use Doctrine Attribute Reference, You must change Sonata Entities generated in Entity folder.
55
You can check more details at https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/attributes-reference.html
66

77
You can also use Rector to refactor, check more details at https://getrector.org/blog/how-to-upgrade-annotations-to-attributes
88
</comment>
9-
2. Apply the migration generated <info>php bin/console doctrine:migrations:migrate --no-interaction</info>
9+
2. Apply the migration generated <info>bin/console doctrine:migrations:migrate --no-interaction</info>
1010
3. Create your first site: <info>bin/console sonata:page:create-site --enabled --name=localhost --locale=- --host=localhost --relativePath=- --enabledFrom=now --enabledTo=- --default</info>
1111
<comment>After you generate your site, You will see few commands to execute to have your Site ready.</comment>
1212

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
sonata_block:
2+
default_contexts: [sonata_page_bundle]
3+
4+
sonata_admin:
5+
assets:
6+
extra_javascripts:
7+
- bundles/sonatapage/app.js
8+
extra_stylesheets:
9+
- bundles/sonatapage/app.css
10+
11+
# https://docs.sonata-project.org/projects/SonataPageBundle/en/4.x/reference/advanced_configuration/
12+
sonata_page:
13+
multisite: host
14+
use_streamed_response: false
15+
16+
router_auto_register:
17+
enabled: true
18+
priority: 150
19+
ignore_route_patterns:
20+
- ^(.*)admin(.*) # ignore admin route, ie route containing 'admin'
21+
- ^_(.*) # ignore symfony routes
22+
ignore_routes:
23+
- sonata_page_cache_esi
24+
- sonata_page_cache_ssi
25+
- sonata_page_js_sync_cache
26+
- sonata_page_js_async_cache
27+
- sonata_cache_esi
28+
- sonata_cache_ssi
29+
- sonata_cache_js_async
30+
- sonata_cache_js_sync
31+
- sonata_cache_apc
32+
ignore_uri_patterns:
33+
- ^/admin\/ # ignore admin route, ie route containing 'admin'
34+
35+
#https://docs.sonata-project.org/projects/SonataPageBundle/en/4.x/reference/page_composer/
36+
default_template: default
37+
templates:
38+
default:
39+
path: '@SonataPage/layout.html.twig'
40+
name: 'default'
41+
containers:
42+
header:
43+
name: Header
44+
content_top:
45+
name: Top content
46+
content:
47+
name: Main content
48+
content_bottom:
49+
name: Bottom content
50+
footer:
51+
name: Footer
52+
matrix:
53+
layout: |
54+
HHHHHHHH
55+
HHHHHHHH
56+
TTTTTTTT
57+
TTTTTTTT
58+
CCCCCCCC
59+
CCCCCCCC
60+
BBBBBBBB
61+
BBBBBBBB
62+
FFFFFFFF
63+
FFFFFFFF
64+
65+
mapping:
66+
H: header
67+
T: content_top
68+
C: content
69+
B: content_bottom
70+
F: footer
71+
72+
direct_publication: '%kernel.debug%'
73+
74+
catch_exceptions:
75+
not_found: [404] # render 404 page with "not_found" key (name generated: _page_internal_error_{key})
76+
fatal: [500] # so you can use the same page for different http errors or specify specific page for each error
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sonata_page_exceptions:
2+
resource: '@SonataPageBundle/Resources/config/routing/exceptions.xml'
3+
prefix: /
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"bundles": {
3+
"Sonata\\PageBundle\\SonataPageBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"config/": "%CONFIG_DIR%/",
7+
"src/": "%SRC_DIR%/"
8+
}
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* Your Page is almost ready:
2+
1. Generate a migration for Sonata Page Database <info>php bin/console doctrine:migrations:diff</info>
3+
2. Apply the migration generated <info>php bin/console doctrine:migrations:migrate --no-interaction</info>
4+
3. Create your first site: <info>bin/console sonata:page:create-site --enabled --name=localhost --locale=- --host=localhost --relativePath=- --enabledFrom=now --enabledTo=- --default</info>
5+
<comment>Now you can create your first page at <info>/admin</info></comment>
6+
7+
* <fg=blue>Documentation</> <comment>https://docs.sonata-project.org/projects/SonataPageBundle/en/4.x/</comment>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Entity;
6+
7+
use Doctrine\DBAL\Types\Types;
8+
use Doctrine\ORM\Mapping as ORM;
9+
use Sonata\PageBundle\Entity\BaseBlock;
10+
11+
#[ORM\Entity]
12+
#[ORM\Table(name: 'page__block')]
13+
class SonataPageBlock extends BaseBlock
14+
{
15+
#[ORM\Id]
16+
#[ORM\Column(type: Types::INTEGER)]
17+
#[ORM\GeneratedValue]
18+
protected $id;
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Entity;
6+
7+
use Doctrine\DBAL\Types\Types;
8+
use Doctrine\ORM\Mapping as ORM;
9+
use Sonata\PageBundle\Entity\BasePage;
10+
11+
#[ORM\Entity]
12+
#[ORM\Table(name: 'page__page')]
13+
class SonataPagePage extends BasePage
14+
{
15+
#[ORM\Id]
16+
#[ORM\Column(type: Types::INTEGER)]
17+
#[ORM\GeneratedValue]
18+
protected $id;
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Entity;
6+
7+
use Doctrine\DBAL\Types\Types;
8+
use Doctrine\ORM\Mapping as ORM;
9+
use Sonata\PageBundle\Entity\BaseSite;
10+
11+
#[ORM\Entity]
12+
#[ORM\Table(name: 'page__site')]
13+
class SonataPageSite extends BaseSite
14+
{
15+
#[ORM\Id]
16+
#[ORM\Column(type: Types::INTEGER)]
17+
#[ORM\GeneratedValue]
18+
protected $id;
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Entity;
6+
7+
use Doctrine\DBAL\Types\Types;
8+
use Doctrine\ORM\Mapping as ORM;
9+
use Sonata\PageBundle\Entity\BaseSnapshot;
10+
11+
#[ORM\Entity]
12+
#[ORM\Table(name: 'page__snapshot')]
13+
class SonataPageSnapshot extends BaseSnapshot
14+
{
15+
#[ORM\Id]
16+
#[ORM\Column(type: Types::INTEGER)]
17+
#[ORM\GeneratedValue]
18+
protected $id;
19+
}

0 commit comments

Comments
 (0)