Files
pcm-metadata-bundle/README.md
2025-11-27 15:17:26 +00:00

20 lines
535 B
Markdown

# PCM Metadata Bundle
Easily add metadata to a Symfony entity via the use of a key-value interface.
# Usage
1. Use the `MetadataTrait` inside an entity:
```php
class MyEntity
{
use MetadataTrait;
}
```
2. Create and execute a new migration. The trait adds a `metadata` database field and as such we need to create a migration.
3. Access the metadata object with the readonly property `metadata`:
```php
$entity->metadata->set("name", "PCM");
$entity->metadata->get("name"); // "PCM"
$entity->metadata->isSet("name"); // true
```