61d503315dba7d5e59f4088d3fa2ac6342b6bc4a
PCM Metadata Bundle
Easily add scalar metadata to a Symfony entity via the use of a key-value interface.
Usage
- Use the
MetadataTraitinside an entity:
class MyEntity
{
use MetadataTrait;
}
- Create and execute a new migration. The trait adds a
metadatadatabase field and as such we need to create a migration. - Access the metadata object with the readonly property
metadata:
$entity->metadata->set("name", "PCM");
$entity->metadata->get("name"); // "PCM"
$entity->metadata->isSet("name"); // true
Like setting a property normally, setting metadata values will not automatically update the database. You must call
flush()from theEntityManageras usual when you wish to persist data.
Languages
PHP
81.4%
Shell
11.4%
Makefile
5.6%
Dockerfile
1.6%