Skip to content

Entity Interface migration note. #8017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions en/appendices/6-0-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Datasource

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

ORM
---
Expand Down
6 changes: 1 addition & 5 deletions en/orm/entities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ You can check if fields are defined in your entities with ``has()``::
$article->has('undefined'); // false

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

$article = new Article([
Expand All @@ -142,19 +142,15 @@ value::
'links' => [],
]);
$article->has('title'); // true
$article->isEmpty('title'); // false
$article->hasValue('title'); // true

$article->has('user_id'); // true
$article->isEmpty('user_id'); // true
$article->hasValue('user_id'); // false

$article->has('text'); // true
$article->isEmpty('text'); // true
$article->hasValue('text'); // false

$article->has('links'); // true
$article->isEmpty('links'); // true
$article->hasValue('links'); // false

If you often partially load entities you should enable strict-property access
Expand Down
Loading