Skip to content

Commit 23abb7f

Browse files
authored
Merge pull request #8023 from cakephp/pull-18354
Update docs for cakephp/cakephp#18354
2 parents 25e1abe + d3c86b2 commit 23abb7f

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

en/appendices/5-3-migration-guide.rst

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ ORM
3737
- Calling behavior methods on table instances is now deprecated. To call
3838
a method of an attached behavior you need to use
3939
``$table->getBehavior('Sluggable')->slugify()`` instead of ``$table->slugify()``.
40+
- ``EntityTrait::isEmpty()`` is deprecated. Use ``hasValue()`` instead.
4041

4142
New Features
4243
============

en/orm/entities.rst

+1-6
Original file line numberDiff line numberDiff line change
@@ -132,8 +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'
136-
value::
135+
``hasValue()`` to check if a field contains a 'non-empty' value::
137136

138137
$article = new Article([
139138
'title' => 'First post',
@@ -142,19 +141,15 @@ value::
142141
'links' => [],
143142
]);
144143
$article->has('title'); // true
145-
$article->isEmpty('title'); // false
146144
$article->hasValue('title'); // true
147145

148146
$article->has('user_id'); // true
149-
$article->isEmpty('user_id'); // true
150147
$article->hasValue('user_id'); // false
151148

152149
$article->has('text'); // true
153-
$article->isEmpty('text'); // true
154150
$article->hasValue('text'); // false
155151

156152
$article->has('links'); // true
157-
$article->isEmpty('links'); // true
158153
$article->hasValue('links'); // false
159154

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

fr/orm/entities.rst

+1-7
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Vous pouvez vérifier si des champs sont définis dans vos entities avec
136136
$article->has('undefined'); // false.
137137

138138
La méthode ``has()`` va renvoyer ``true`` si un champ est défini est a une
139-
valeur non null. Vous pouvez utiliser ``isEmpty()`` et ``hasValue()`` pour
139+
valeur non null. Vous pouvez utiliser ``hasValue()`` pour
140140
vérifier si un champ contient une valeur 'non-empty'::
141141

142142
$article = new Article([
@@ -147,27 +147,21 @@ vérifier si un champ contient une valeur 'non-empty'::
147147
]);
148148
]);
149149
$article->has('title'); // true
150-
$article->isEmpty('title'); // false
151150
$article->hasValue('title'); // true
152151

153152
$article->has('user_id'); // true
154-
$article->isEmpty('user_id'); // true
155153
$article->hasValue('user_id'); // false
156154

157155
$article->has('text'); // true
158-
$article->isEmpty('text'); // true
159156
$article->hasValue('text'); // false
160157

161158
$article->has('links'); // true
162-
$article->isEmpty('links'); // true
163159
$article->hasValue('links'); // false
164160

165161
$article->has('text'); // true
166-
$article->isEmpty('text'); // true
167162
$article->hasValue('text'); // false
168163

169164
$article->has('links'); // true
170-
$article->isEmpty('links'); // true
171165
$article->hasValue('links'); // false
172166

173167
Accesseurs & Mutateurs

ja/orm/entities.rst

+1-4
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,14 @@ CakePHP の ORM を使うためにエンティティークラスを生成する
109109
$article->has('undefined'); // false.
110110

111111
``has()`` メソッドは、プロパティが定義されていてヌル以外の値を持つ場合、 ``true`` を返します。
112-
``isEmpty()`` と ``hasValue()`` を使って、プロパティに '空でない' 値が含まれているかどうかを
112+
``hasValue()`` を使って、プロパティに '空でない' 値が含まれているかどうかを
113113
調べることができます。 ::
114114

115115
$article = new Article([
116116
'title' => 'First post',
117117
'user_id' => null
118118
]);
119-
$article->isEmpty('title'); // false
120119
$article->hasValue('title'); // true
121-
122-
$article->isEmpty('user_id'); // true
123120
$article->hasValue('user_id'); // false
124121

125122
アクセサーとミューテーター

0 commit comments

Comments
 (0)