AI prompts
base on Doctrine2 behavioral extensions, Translatable, Sluggable, Tree-NestedSet, Timestampable, Loggable, Sortable # Doctrine Behavioral Extensions
[![Continuous Integration](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/continuous-integration.yml)
[![Quality Assurance](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/qa.yml/badge.svg)](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/qa.yml)
[![Coding Standards](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/doctrine-extensions/DoctrineExtensions/actions/workflows/coding-standards.yml)
[![Latest Stable Version](https://poser.pugx.org/gedmo/doctrine-extensions/version)](https://packagist.org/packages/gedmo/doctrine-extensions)
This package contains extensions for Doctrine ORM and MongoDB ODM that offer new functionality or tools to use Doctrine
more efficiently. These behaviors can be easily attached to the event system of Doctrine and handle the records being
flushed in a behavioral way.
---
## Doctrine Extensions 3.0 Released :tada:
3.0 focuses on refreshing this package for today's PHP. This includes:
- Bumping minimum version requirements of PHP, Doctrine, and other dependencies
- Implementing support for the latest Doctrine MongoDB & Common packages
- Updating the test suite, add code and style standards, and other needed build tools
- Cleaning up documentation, code, comments, etc.
[Read the Upgrade Doc for more info.](/doc/upgrading/upgrade-v2.4-to-v3.0.md)
---
## Installation
composer require gedmo/doctrine-extensions
* [Symfony](/doc/frameworks/symfony.md)
* [Laravel](/doc/frameworks/laravel.md)
* [Laminas](/doc/frameworks/laminas.md)
### Upgrading
* [From 2.4.x to 3.0](/doc/upgrading/upgrade-v2.4-to-v3.0.md)
## Extensions
#### ORM & MongoDB ODM
- [**Blameable**](/doc/blameable.md) - updates string or reference fields on create, update and even property change with a string or object (e.g. user).
- [**Loggable**](/doc/loggable.md) - helps tracking changes and history of objects, also supports version management.
- [**Sluggable**](/doc/sluggable.md) - urlizes your specified fields into single unique slug
- [**Timestampable**](/doc/timestampable.md) - updates date fields on create, update and even property change.
- [**Translatable**](/doc/translatable.md) - gives you a very handy solution for translating records into different languages. Easy to setup, easier to use.
- [**Tree**](/doc/tree.md) - automates the tree handling process and adds some tree-specific functions on repository.
(**closure**, **nested set** or **materialized path**)
_(MongoDB ODM only supports materialized path)_
#### ORM Only
- [**IpTraceable**](/doc/ip_traceable.md) - inherited from Timestampable, sets IP address instead of timestamp
- [**SoftDeleteable**](/doc/softdeleteable.md) - allows to implicitly remove records
- [**Sortable**](/doc/sortable.md) - makes any document or entity sortable
- [**Uploadable**](/doc/uploadable.md) - provides file upload handling in entity fields
#### MongoDB ODM Only
- [**References**](/doc/references.md) - supports linking Entities in Documents and vice versa
- [**ReferenceIntegrity**](/doc/reference_integrity.md) - constrains ODM MongoDB Document references
All extensions support **Attribute**, **XML** and **Annotation** (deprecated) mapping. Additional mapping drivers
can be easily implemented using Mapping extension to handle the additional metadata mapping.
### Version Compatibility
* DBAL: `^3.2` (for all the extensions) or `^4.0` (for all the extensions, except **Loggable**)
* ORM: `^2.14` or `^3.0`
* MongoDB ODM: `^2.3`
If you are setting up the Entity Manager without a framework, see the [example](/example/em.php) to prevent issues like #1310
### XML Mapping
XML mapping needs to be in a different namespace, the declared namespace for
Doctrine extensions is http://gediminasm.org/schemas/orm/doctrine-extensions-mapping
So root node now looks like this:
```xml
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
...
</doctrine-mapping>
```
XML mapping xsd schemas are also versioned and can be used by version suffix:
- Latest version - **http://gediminasm.org/schemas/orm/doctrine-extensions-mapping**
- 2.2.x version - **http://gediminasm.org/schemas/orm/doctrine-extensions-mapping-2-2**
- 2.1.x version - **http://gediminasm.org/schemas/orm/doctrine-extensions-mapping-2-1**
### Running Tests
To set up and run the tests, follow these steps:
- Install [Docker](https://www.docker.com/) and ensure you have `docker compose`
- From the project root, run `docker compose up -d` to start containers in daemon mode
- Enter the container via `docker compose exec php bash` (you are now in the root directory: `/var/www`)
- Install Composer dependencies via `composer install`
- Run the tests: `vendor/bin/phpunit`
### Running the Example
To set up and run example, follow these steps:
- go to the root directory of extensions
- [download composer](https://getcomposer.org/download/)
- install dev libraries: `composer install`
- edit `example/em.php` and configure your database on top of the file
- run: `php example/bin/console` or `php example/bin/console` for console commands
- run: `php example/bin/console orm:schema-tool:create` to create the schema
- run: `php example/bin/console app:print-category-translation-tree` to run the example to print the category translation tree
### Contributors
Thanks to [everyone participating](https://github.com/doctrine-extensions/DoctrineExtensions/contributors) in
the development of these great Doctrine extensions!
And especially ones who create and maintain new extensions:
- Lukas Botsch [lbotsch](https://github.com/lbotsch)
- Gustavo Adrian [comfortablynumb](https://github.com/comfortablynumb)
- Boussekeyt Jules [gordonslondon](https://github.com/gordonslondon)
- Kudryashov Konstantin [everzet](https://github.com/everzet)
- David Buchmann [dbu](https://github.com/dbu)
", Assign "at most 3 tags" to the expected json: {"id":"1979","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"