Skip to content

Commit 4810c7d

Browse files
committed
Update readme
1 parent b54bfa1 commit 4810c7d

File tree

1 file changed

+18
-27
lines changed

1 file changed

+18
-27
lines changed

README.md

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
[![Build Status](https://github.com/compositephp/entity/actions/workflows/main.yml/badge.svg)](https://github.com/compositephp/entity/actions)
44
[![Codecov](https://codecov.io/gh/compositephp/entity/branch/master/graph/badge.svg)](https://codecov.io/gh/compositephp/entity/)
55

6-
Composite Entity is a lightweight and intelligent PHP 8.1+ class that shines in its ability to be serialized and deserialized from an array.
7-
This smart feature makes it extremely useful when managing data from databases.
6+
Composite Entity is a PHP 8.1+ lightweight class designed for efficient and intelligent data handling.
7+
It specializes in the serialization and deserialization of data, making it highly beneficial for database management.
88

9-
It efficiently converts database rows into a strictly typed object and back into an array, enhancing your workflow and making your interaction with databases much smoother and more productive.
9+
## Features
10+
* Converts database rows to strictly typed objects and vice versa.
11+
* Streamlines database interactions.
1012

1113
Overview:
1214
* [Requirements](#requirements)
@@ -16,31 +18,23 @@ Overview:
1618

1719
## Requirements
1820

19-
* PHP 8.1+
21+
* PHP 8.1 or higher.
2022

2123
## Installation
2224

23-
Install package via composer:
25+
Install using Composer::
2426

2527
```shell
2628
$ composer require compositephp/entity
2729
```
2830

2931
## Supported column types:
3032

31-
Composite Entity has the capability to automatically serialize and deserialize nearly all data types you might require.
32-
- String
33-
- Integer
34-
- Float
35-
- Bool
36-
- Array
37-
- Object (stdClass)
38-
- DateTime and DateTimeImmutable
39-
- Enum
40-
- Another Entity
41-
- List of map of Entities
42-
- Collection (any ArrayAccess instance, e.g. Doctrine Collection)
43-
- Custom class that implements `Composite\DB\Entity\CastableInterface`
33+
Composite Entity supports a wide range of data types:
34+
35+
* Basic types: String, Integer, Float, Bool, Array.
36+
* Complex types: Object (stdClass), DateTime/DateTimeImmutable, Enum.
37+
* Advanced types: Entity, Entity Lists or Maps, Collections (e.g., Doctrine Collection), Custom classes implementing Composite\DB\Entity\CastableInterface.
4438

4539
## Quick example
4640

@@ -113,23 +107,20 @@ And that's it, no special getters or setters, no "behaviours" or extra code, Com
113107

114108
### Custom Hydration
115109

116-
If you like to have a full control or best performance during the serialization and deserialization of the entity you can
117-
implement your own Hydrator. To do this, follow the simple steps:
110+
For tailored performance, implement your own hydrator:
118111

119-
1. Create class and implement `Composite\Entity\HydratorInterface`
120-
2. Add attribute `Composite\Entity\Attributes\Hydrator` to your entity class.
112+
1. Create a class implementing `Composite\Entity\HydratorInterface`.
113+
2. Add `Composite\Entity\Attributes\Hydrator` attribute to your entity class.
121114

122-
### Usefull Attributes
115+
### Useful Attributes
123116

124117
* #### Composite\Entity\Attributes\SkipSerialization
125118

126-
Add this attribute to any entity property to remove it from the hydration process.
119+
Exclude properties from hydration.
127120

128121
* #### Composite\Entity\Attributes\ListOf
129122

130-
Can be added to array property, indicate the desired target entity class to store list of of this entity in your property.
131-
Use the second parameter `keyColumn` to store the associative array in your property, so you can easily search the entities
132-
by the named key later.
123+
Define lists of entities within a property.
133124

134125
Example:
135126

0 commit comments

Comments
 (0)