docs: Doctrine section with Doctrine Behaviors and Doctrine Helper (uk + en)
en/docs/doctrine/doctrine-behaviors/known_issues/open.md
new file +17
ā0
1
+
# Open issues
2
+
3
+
Known bugs and limitations of the current version of `ufo-tech/doctrine-behaviors` (2.0.0): symptom, cause and workaround. Fixed ones are on the [Fixed issues](/docs/doctrine/doctrine-behaviors/known_issues/fixed) page.
4
+
5
+
<include>(.issues/default-connection-only.md)
6
+
7
+
---
8
+
9
+
<include>(.issues/tree-root-nodes.md)
10
+
11
+
---
12
+
13
+
<include>(.issues/translation-locale-length.md)
14
+
15
+
---
16
+
17
+
<include>(.issues/readme-outdated.md)
en/docs/doctrine/doctrine-behaviors/known_issues/.issues/default-connection-only.md
new file +24
ā0
1
+
### Behaviors work only for the `default` connection
2
+
3
+
:::warning subtitle="Open"
4
+
Affected versions: 1.0.0 ā 2.0.0 (current).
5
+
:::
6
+
7
+
**Symptom.** In an application with several Doctrine connections, entities of a manager working through another connection get no behavior columns and are not filled in (`createdAt`, `slug`, `translations` etc.).
8
+
9
+
**Cause.** All listeners in `src/EventSubscriber/` are registered with `#[AsDoctrineListener(..., connection: 'default')]`, so DoctrineBundle attaches them only to the event manager of the `default` connection.
10
+
11
+
**Workaround.** Register the listeners you need for your connection with the `doctrine.event_listener` tag and `autoconfigure: false` (so the attribute does not also attach a copy to `default`), e.g.:
12
+
13
+
```yaml
14
+
services:
15
+
app.timestampable_reporting:
16
+
class: Ufo\DoctrineBehaviors\EventSubscriber\TimestampableEventSubscriber
17
+
autoconfigure: false
18
+
arguments:
19
+
$timestampableDateFieldType: '%doctrine_behaviors_timestampable_date_field_type%'
20
+
tags:
21
+
- { name: doctrine.event_listener, event: loadClassMetadata, connection: reporting, priority: 500 }
22
+
```
23
+
24
+
`BlameableEventSubscriber` and `SluggableEventSubscriber` (via `DefaultSluggableRepository`) receive `EntityManagerInterface` in the constructor ā pass your connection's manager to them as well (`@doctrine.orm.reporting_entity_manager`). The other listeners take the manager from the event arguments.
en/docs/doctrine/doctrine-behaviors/known_issues/.issues/tree-root-nodes.md
new file +11
ā0
1
+
### `getRootNodes()` does not find nodes made root via `setChildNodeOf(null)`
2
+
3
+
:::warning subtitle="Open"
4
+
Affected versions: 1.0.0 ā 2.0.0 (current). Inherited from KnpLabs/DoctrineBehaviors.
5
+
:::
6
+
7
+
**Symptom.** A node on which `setChildNodeOf(null)` was called is a root for `isRootNode()`, but `TreeTrait::getRootNodes()` does not return it.
8
+
9
+
**Cause.** A new node has `materializedPath = ''`, while `setChildNodeOf(null)` writes `'/'`. `getRootNodesQB()` filters only `materializedPath = ''`.
10
+
11
+
**Workaround.** Do not call `setChildNodeOf(null)` for roots, or select roots with your own query: `->andWhere("t.materializedPath IN ('', '/')")`.
en/docs/doctrine/doctrine-behaviors/known_issues/.issues/translation-locale-length.md
new file +30
ā0
1
+
### The translation `locale` column has length 5
2
+
3
+
:::warning subtitle="Open"
4
+
Affected versions: 1.0.0 ā 2.0.0 (current). Inherited from KnpLabs/DoctrineBehaviors.
5
+
:::
6
+
7
+
**Symptom.** A translation with a locale longer than 5 characters (`sr_Latn`, `zh_Hant`, `de_CH_1996`) is not saved on databases that check string length (MySQL in strict mode, PostgreSQL) ā a "value too long" / "Data too long" error.
8
+
9
+
**Cause.** `TranslatableEventSubscriber::mapTranslation()` maps `locale` as a `string` with `length: 5`.
10
+
11
+
**Workaround.** The bundle does not map `locale` if the field is already mapped. Use `TranslationMethodsTrait` instead of `TranslationTrait` in the translation entity and declare the properties yourself:
12
+
13
+
```php
14
+
use Ufo\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
15
+
use Ufo\DoctrineBehaviors\Contract\Entity\TranslationInterface;
16
+
use Ufo\DoctrineBehaviors\Model\Translatable\TranslationMethodsTrait;
17
+
18
+
#[ORM\Entity]
19
+
class CategoryTranslation implements TranslationInterface
20
+
{
21
+
use TranslationMethodsTrait;
22
+
23
+
#[ORM\Column(length: 16)]
24
+
protected ?string $locale = null;
25
+
26
+
protected ?TranslatableInterface $translatable = null;
27
+
28
+
// ...
29
+
}
30
+
```
en/docs/doctrine/doctrine-behaviors/known_issues/.issues/readme-outdated.md
new file +12
ā0
1
+
### The package README and docs/ are outdated
2
+
3
+
:::warning subtitle="Open"
4
+
Affected versions: 2.0.0 (current). A documentation mismatch, does not affect behavior.
5
+
:::
6
+
7
+
* `README.md` states PHP >= 8.2, DBAL ^3.2 | ^4.2, ORM ^3.3, DoctrineBundle ^2.6 ā in 2.0.0 it is PHP >= 8.4, DBAL ^4.2, ORM ^3.7, DoctrineBundle ^3.0.
8
+
* The README behavior list lacks Sluggable and Loggable; Blameable is described as `createdBy` / `updatedBy` without `deletedBy`; Uuid ā as "UUIDs as primary keys", although `uuid` is a separate column.
9
+
* The "Usage" section links to the KnpLabs documentation; `CHANGELOG.md` ends at 1.0.0.
10
+
* The examples in `docs/*.md` mostly use `@ORM\Entity` annotations, which Doctrine ORM 3 no longer has; `translatable.md` links to the non-existent `github.com/Ufo/DoctrineBehaviors`; `tree.md` does not mention that `$root[0]` needs `ArrayAccess` and that `getTree()` comes from `TreeTrait` in the repository.
11
+
12
+
The up-to-date description is on this site.