Adds a functionality for Doctrine, so it can be used by nested set model defined here.
composer require janisbiz/doctrine-nested-set
These instructions will help you set up this doctrine extension, so you can use it. As well, there are provided instructions to run integration tests for the extension.
To use extension:
- your entity class should implement NestedSetEntityInterface
- your repository class should extend NestedSetEntityRepository
Afterwards you can use helper functions from NestedSetEntityRepository, which are sufficient for full operations on nested set tree model.
There are two ways to run tests:
- By using docker containers:
- Copy
.env.dist
to.env
and adjust defined values for your needs - Execute
docker-compose up -d --build
- Execute
docker-compose exec php composer install
- Execute
docker-compose exec php vendor/bin/behat
- Copy
- By using your local php and mysql database environment:
- Ensure, that your php version is
7.1.x
- Install
pdo_mysql
extension for php - Adjust database connection in configuration file
- Execute
composer install
- Execute
vendor/bin/behat
- Ensure, that your php version is