Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Upgrade Notes

## Unreleased
- **[ENHANCEMENT]** Add support for doctrine 3.x

## 3.2.2
- [BUGFIX] Xliff Export: pass null values as empty string

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"ext-dom": "*",
"pimcore/pimcore": "^11.0",
"google/apiclient": "^2.12",
"doctrine/orm": "^2.7"
"doctrine/orm": "^2.7 || ^3.0"
},
"require-dev": {
"codeception/codeception": "^5.0",
Expand Down
35 changes: 0 additions & 35 deletions config/doctrine/model/ElementMetaData.orm.yml

This file was deleted.

41 changes: 0 additions & 41 deletions config/doctrine/model/QueueEntry.orm.yml

This file was deleted.

19 changes: 19 additions & 0 deletions src/Model/ElementMetaData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,32 @@

namespace SeoBundle\Model;

use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\Table;
use Doctrine\ORM\Mapping\UniqueConstraint;

#[Entity]
#[Table(name: 'seo_element_meta_data')]
#[UniqueConstraint(name: 'element_type_id_integrator', columns: ['element_type', 'element_id', 'integrator', 'release_type'])]
class ElementMetaData implements ElementMetaDataInterface
{
#[Id]
#[Column(name: 'id', type: 'integer')]
#[GeneratedValue(strategy: 'AUTO')]
protected ?int $id = null;

#[Column(name: 'element_type', type: 'string', nullable: false)]
protected string $elementType;
#[Column(name: 'element_id', type: 'integer', nullable: false)]
protected int $elementId;
#[Column(name: 'integrator', type: 'string', nullable: false)]
protected string $integrator;
#[Column(name: 'data', type: 'array', nullable: false)]
protected array $data = [];
#[Column(name: 'release_type', type: 'string', nullable: false, options: ['default' => 'public'])]
protected string $releaseType;

public function setId(int $id): void
Expand Down
20 changes: 20 additions & 0 deletions src/Model/QueueEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,35 @@

namespace SeoBundle\Model;

use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\CustomIdGenerator;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\Table;

#[Entity]
#[Table(name: 'seo_queue_entry')]
class QueueEntry implements QueueEntryInterface
{
#[Id]
#[Column(name: 'uuid', type: 'uuid')]
#[GeneratedValue(strategy: 'CUSTOM')]
#[CustomIdGenerator(class: 'doctrine.uuid_generator')]
protected string $uuid;
#[Column(name: '`type`', type: 'string', nullable: false)]
protected string $type;
#[Column(name: 'data_type', type: 'string', nullable: false)]
protected string $dataType;
#[Column(name: 'data_id', type: 'integer', nullable: false)]
protected int $dataId;
#[Column(name: 'data_url', type: 'text', nullable: false)]
protected string $dataUrl;
#[Column(name: 'worker', type: 'string', nullable: false)]
protected string $worker;
#[Column(name: 'resource_processor', type: 'string', nullable: false)]
protected string $resourceProcessor;
#[Column(name: 'creation_date', type: 'datetime', nullable: false)]
protected \DateTime $creationDate;

public function setUuid(string $uuid): void
Expand Down
13 changes: 8 additions & 5 deletions src/SeoBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ protected function getComposerPackageName(): string
protected function configureDoctrineExtension(ContainerBuilder $container): void
{
$container->addCompilerPass(
DoctrineOrmMappingsPass::createYamlMappingDriver(
[$this->getNameSpacePath() => $this->getNamespaceName()],
DoctrineOrmMappingsPass::createAttributeMappingDriver(
[$this->getNamespaceName()],
[$this->getNameSpacePath()],
['seo.persistence.doctrine.manager'],
'seo.persistence.doctrine.enabled'
'seo.persistence.doctrine.enabled',
[],
true
)
);
}
Expand All @@ -82,9 +85,9 @@ protected function getNamespaceName(): string
protected function getNameSpacePath(): string
{
return sprintf(
'%s/config/doctrine/%s',
'%s/src/%s',
$this->getPath(),
'model'
'Model'
);
}
}