Skip to content

Commit fe79712

Browse files
authored
Merge pull request #8017 from cakephp/6.x-entity-trait
Entity Interface migration note.
2 parents de05445 + 70ec5be commit fe79712

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

en/appendices/6-0-migration-guide.rst

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Datasource
2626

2727
- ``Datasource/Paging/PaginatedInterface`` now extends ``IteratorAggregate``
2828
instead of ``Traversable``.
29+
- ``EntityTrait::isEmpty()`` has been dropped in favor of ``hasValue()``.
2930

3031
Http
3132
----

en/orm/entities.rst

+1-5
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ You can check if fields are defined in your entities with ``has()``::
132132
$article->has('undefined'); // false
133133

134134
The ``has()`` method will return ``true`` if a field is defined. You can use
135-
``isEmpty()`` and ``hasValue()`` to check if a field contains a 'non-empty'
135+
``hasValue()`` to check if a field contains a 'non-empty'
136136
value::
137137

138138
$article = new Article([
@@ -142,19 +142,15 @@ value::
142142
'links' => [],
143143
]);
144144
$article->has('title'); // true
145-
$article->isEmpty('title'); // false
146145
$article->hasValue('title'); // true
147146

148147
$article->has('user_id'); // true
149-
$article->isEmpty('user_id'); // true
150148
$article->hasValue('user_id'); // false
151149

152150
$article->has('text'); // true
153-
$article->isEmpty('text'); // true
154151
$article->hasValue('text'); // false
155152

156153
$article->has('links'); // true
157-
$article->isEmpty('links'); // true
158154
$article->hasValue('links'); // false
159155

160156
If you often partially load entities you should enable strict-property access

0 commit comments

Comments
 (0)