From 70ec5be846410c62f1e3f12481012d0dccca8da4 Mon Sep 17 00:00:00 2001 From: mscherer Date: Wed, 16 Apr 2025 03:04:43 +0200 Subject: [PATCH] Entity Interface migration note. --- en/appendices/6-0-migration-guide.rst | 1 + en/orm/entities.rst | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/en/appendices/6-0-migration-guide.rst b/en/appendices/6-0-migration-guide.rst index 1c3c7c89c3..afa92f7979 100644 --- a/en/appendices/6-0-migration-guide.rst +++ b/en/appendices/6-0-migration-guide.rst @@ -26,6 +26,7 @@ Datasource - ``Datasource/Paging/PaginatedInterface`` now extends ``IteratorAggregate`` instead of ``Traversable``. +- ``EntityTrait::isEmpty()`` has been dropped in favor of ``hasValue()``. ORM --- diff --git a/en/orm/entities.rst b/en/orm/entities.rst index accc6ab40b..cf35532dc1 100644 --- a/en/orm/entities.rst +++ b/en/orm/entities.rst @@ -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([ @@ -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