diff --git a/CHANGELOG.md b/CHANGELOG.md index bc6cc4a..4163ec8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Bug #87: Update `.gitattributes` to exclude additional files from the package, update `LICENSE.md` and add stable version worflows actions (@terabytesoftw) - Bug #88: Remove unused command coverage options from mutation workflow configuration (@terabytesoftw) - Bug #89: Update `php-forge/support` version `0.2` in `composer.json` and refactor assertions in test cases (@terabytesoftw) +- Bug #90: Update badge styles and links in `README.md`, reorganize sections for clarity (@terabytesoftw) ## 0.1.0 July 8, 2025 diff --git a/README.md b/README.md index 718dd33..1b6b450 100644 --- a/README.md +++ b/README.md @@ -8,23 +8,23 @@
A powerful behavior for managing hierarchical data structures using the nested sets pattern in Yii ActiveRecord models. @@ -49,15 +49,7 @@ with high-performance database operations. [](https://github.com/yii2-extensions/nested-sets-behavior/actions/workflows/build-pgsql.yml) [](https://github.com/yii2-extensions/nested-sets-behavior/actions/workflows/build.yml) -## Quick start - -### Installation - -```bash -composer require yii2-extensions/nested-sets-behavior -``` - -### How it works +## How it works The nested sets model is a technique for storing hierarchical data in a relational database. Unlike adjacency lists (parent_id approach), nested sets enable efficient tree operations with minimal database queries. @@ -67,7 +59,7 @@ The nested sets model is a technique for storing hierarchical data in a relation 3. **Optimizes queries** using boundary values for efficient tree traversal. 4. **Supports transactions** to ensure data integrity during complex operations. -#### Why nested sets? +**Why nested sets?** - **Fast queries**: Get all descendants with a single query (`lft BETWEEN parent.lft AND parent.rgt`). - **Efficient tree operations**: No recursive queries needed for tree traversal. @@ -86,6 +78,12 @@ Electronics (1,12,0) Numbers represent: (left, right, depth) ``` +### Installation + +```bash +composer require yii2-extensions/nested-sets-behavior +``` + ### Database setup The package includes ready-to-use migrations for creating the necessary database structure. @@ -168,7 +166,7 @@ CREATE INDEX idx_multiple_tree_depth ON multiple_tree (depth); CREATE INDEX idx_multiple_tree_tree_lft_rgt ON multiple_tree (tree, lft, rgt); ``` -### Basic Configuration +### Quick start Add the behavior to your ActiveRecord model. @@ -215,8 +213,6 @@ class Category extends ActiveRecord } ``` -### Basic Usage - #### Creating and building trees ```php @@ -304,7 +300,7 @@ $phones->delete(); $phones->deleteWithChildren(); ``` -### Query builder integration +#### Query builder integration Add query behavior for advanced tree queries. @@ -364,21 +360,24 @@ For detailed configuration options and advanced usage. - 💡 [Usage Examples](docs/examples.md) - 🧪 [Testing Guide](docs/testing.md) +## Package information + +[](https://packagist.org/packages/yii2-extensions/nested-sets-behavior) +[](https://packagist.org/packages/yii2-extensions/nested-sets-behavior) + ## Quality code -[](https://github.com/yii2-extensions/nested-sets-behavior/releases) -[](https://packagist.org/packages/yii2-extensions/nested-sets-behavior) -[](https://codecov.io/gh/yii2-extensions/nested-sets-behavior) -[](https://github.com/yii2-extensions/nested-sets-behavior/actions/workflows/static.yml) -[](https://github.styleci.io/repos/717718161?branch=main) +[](https://codecov.io/gh/yii2-extensions/nested-sets-behavior) +[](https://github.com/yii2-extensions/nested-sets-behavior/actions/workflows/static.yml) +[](https://github.styleci.io/repos/717718161?branch=main) ## Our social networks -[](https://x.com/Terabytesoftw) +[](https://x.com/Terabytesoftw) ## License -[](LICENSE.md) +[](LICENSE.md) ## Fork