Skip to content

Commit

Permalink
1169425252 - RedirectionHistory recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRethore committed Oct 25, 2024
1 parent 8a476b0 commit e3f73a0
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 0 deletions.
20 changes: 20 additions & 0 deletions faros-ng/seo-bundle/3.7/config/packages/faros_seo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
faros_seo:
redirection:
enable: true
exclude_patterns:
- ^/admin
- ^/api
- ^/assets
- ^/bundles
- ^/build
- ^/translations
- ^/js
- ^/image
- ^/media
- ^/_profiler
rewrite_redirect: false
redirection_class: App\Entity\Seo\Redirection
redirection_history_class: App\Entity\Seo\RedirectionHistory
redirection_history_save_path: '%kernel.project_dir%/var/history'
rule_class: App\Entity\Seo\Rule
rule_exception_class: App\Entity\Seo\RuleException
9 changes: 9 additions & 0 deletions faros-ng/seo-bundle/3.7/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"bundles": {
"Faros\\Bundle\\SeoBundle\\FarosSeoBundle": ["all"]
},
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/",
"src/": "%SRC_DIR%/"
}
}
7 changes: 7 additions & 0 deletions faros-ng/seo-bundle/3.7/post-install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<bg=blue;fg=white> </>
<bg=blue;fg=white> What's next? </>
<bg=blue;fg=white> </>

* <fg=blue>Update</> your database schema:
1. <comment>php bin/console doctrine:migrations:diff</comment>
2. <comment>php bin/console doctrine:migrations:migrate</comment>
20 changes: 20 additions & 0 deletions faros-ng/seo-bundle/3.7/src/Entity/Seo/Redirection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Entity\Seo;

use Doctrine\ORM\Mapping as ORM;
use Faros\Bundle\SeoBundle\Repository\RedirectionRepository;
use Faros\Component\Seo\Model\Redirection as RedirectionModel;

#[ORM\Entity(repositoryClass: RedirectionRepository::class)]
#[ORM\Table(name: 'seo_redirection')]
class Redirection extends RedirectionModel
{
/**
* @var int|null
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
protected $id;
}
20 changes: 20 additions & 0 deletions faros-ng/seo-bundle/3.7/src/Entity/Seo/RedirectionHistory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Entity\Seo;

use Doctrine\ORM\Mapping as ORM;
use Faros\Bundle\SeoBundle\Repository\RedirectionHistoryRepository;
use Faros\Component\Seo\Model\RedirectionHistory as RedirectionHistoryModel;

#[ORM\Entity(repositoryClass: RedirectionHistoryRepository::class)]
#[ORM\Table(name: 'seo_redirection_history')]
class RedirectionHistory extends RedirectionHistoryModel
{
/**
* @var int|null
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
protected $id;
}
27 changes: 27 additions & 0 deletions faros-ng/seo-bundle/3.7/src/Entity/Seo/Rule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace App\Entity\Seo;

use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Faros\Bundle\SeoBundle\Repository\RuleRepository;
use Faros\Component\Seo\Model\Rule as RuleModel;

#[ORM\Entity(repositoryClass: RuleRepository::class)]
#[ORM\Table(name: 'seo_rule')]
class Rule extends RuleModel
{
/**
* @var int|null
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
protected $id;

/**
* @var Collection<int, RuleException>
*/
#[ORM\OneToMany(targetEntity: RuleException::class, mappedBy: 'rule')]
protected $exceptions;
}
25 changes: 25 additions & 0 deletions faros-ng/seo-bundle/3.7/src/Entity/Seo/RuleException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace App\Entity\Seo;

use Doctrine\ORM\Mapping as ORM;
use Faros\Component\Seo\Model\RuleException as RuleExceptionModel;

#[ORM\Entity]
#[ORM\Table(name: 'seo_rule_exception')]
class RuleException extends RuleExceptionModel
{
/**
* @var int|null
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
protected $id;

/**
* @var Rule|null
*/
#[ORM\ManyToOne(targetEntity: Rule::class, inversedBy: 'exceptions')]
protected $rule;
}

0 comments on commit e3f73a0

Please sign in to comment.