@@ -101,7 +101,8 @@ $user = User::fromArray([
101101]);
102102```
103103
104- And that's it, no special getters or setters, no "behaviours" or extra code, Composite Entity casts everything automatically.
104+ And that's it. No need for special getters or setters, no additional "behaviours" or extra layers of code.
105+ Composite Entity handles everything automatically, ensuring seamless data casting.
105106
106107## Advanced usage
107108
@@ -122,31 +123,31 @@ For tailored performance, implement your own hydrator:
122123
123124 Define lists of entities within a property.
124125
125- Example:
126-
127- ``` php
128- use Composite\Entity\AbstractEntity;
129- use Composite\Entity\Attributes\ListOf;
130-
131- class User extends AbstractEntity
132- {
133- public readonly int $id;
134-
135- public function __construct(
136- public string $name,
137- #[ListOf(Setting::class, 'name' )]
138- public array $settings = [],
139- ) {}
140- }
141-
142- class Setting extends AbstractEntity
143- {
144- public function __construct(
145- public readonly string $name,
146- public bool $isActive,
147- ) {}
148- }
149- ```
126+ Example:
127+
128+ ``` php
129+ use Composite\Entity\AbstractEntity;
130+ use Composite\Entity\Attributes\ListOf;
131+
132+ class User extends AbstractEntity
133+ {
134+ public readonly int $id;
135+
136+ public function __construct(
137+ public string $name,
138+ #[ListOf(Setting::class)]
139+ public array $settings = [],
140+ ) {}
141+ }
142+
143+ class Setting extends AbstractEntity
144+ {
145+ public function __construct(
146+ public readonly string $name,
147+ public bool $isActive,
148+ ) {}
149+ }
150+ ```
150151
151152## License:
152153
0 commit comments