The Becklyn RAD Bundle provides RAD related functionality for the usage in Symfony.
First install the bundle via composer:
composer require becklyn/rad-bundle
- Load the bundle in your
DoctrineModel bundles generic functionality for regular models. Each model should only be responsible for exactly one entity (although there can be multiple models for the same entity).
It mainly adds simple interactions with Doctrine, to get the repository and entity manager of the entity.
The entity class name that is related to this model is automatically guessed on the namespace + class name of your model. If this guessing fails, you can
getFullEntityName() and return the FQCN.
DoctrineModel also provides simple helper functions for persistence:
addEntity($entity)— persists the entity
removeEntity(...$entities)— removes the given entity
flush()— just flushes the entity manager
This bundle also provides several traits that easy the work with Doctrine entities.
Provides a generic ID with getter.
You must initialize the created timestamp in the constructor yourself.
A helper, that helps when working with paths.
join()– joins multiple paths