Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/KnpLabs/DoctrineBehaviors
Doctrine2 behavior traits that help handling Blameable, Loggable, Sluggable, SoftDeletable, Uuidable, Timestampable, Translatable, Tree behavior
https://github.com/KnpLabs/DoctrineBehaviors
behavior doctrine doctrine2 orm php trait
Last synced: 3 months ago
JSON representation
Doctrine2 behavior traits that help handling Blameable, Loggable, Sluggable, SoftDeletable, Uuidable, Timestampable, Translatable, Tree behavior
- Host: GitHub
- URL: https://github.com/KnpLabs/DoctrineBehaviors
- Owner: KnpLabs
- License: mit
- Created: 2012-03-09T15:36:10.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2024-06-11T18:17:31.000Z (8 months ago)
- Last Synced: 2024-07-24T05:47:19.820Z (6 months ago)
- Topics: behavior, doctrine, doctrine2, orm, php, trait
- Language: PHP
- Homepage: http://knplabs.com
- Size: 1.15 MB
- Stars: 913
- Watchers: 49
- Forks: 287
- Open Issues: 62
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Doctrine Behaviors
[![Downloads](https://img.shields.io/packagist/dt/knplabs/doctrine-behaviors.svg?style=flat-square)](https://packagist.org/packages/knplabs/doctrine-behaviors)
This PHP library is a collection of traits and interfaces that add behaviors to Doctrine entities and repositories.
It currently handles:
* [Blameable](/docs/blameable.md)
* [Loggable](/docs/loggable.md)
* [Sluggable](/docs/sluggable.md)
* [SoftDeletable](/docs/soft-deletable.md)
* [Uuidable](/docs/uuidable.md)
* [Timestampable](/docs/timestampable.md)
* [Translatable](/docs/translatable.md)
* [Tree](/docs/tree.md)## Install
```bash
composer require knplabs/doctrine-behaviors
```## Usage
All you have to do is to define a Doctrine entity:
- implemented interface
- add a traitFor some behaviors like tree, you can use repository traits:
```php
import(DoctrineSetList::DOCTRINE_BEHAVIORS_20);
};
```Run Rector:
```bash
vendor/bin/rector process src
```