Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 436 lines (320 sloc) 18.147 kb
b600af6 @qiangxue prepare for 1.1.12 release.
qiangxue authored
1 Upgrading Instructions for Yii Framework v1.1.13
8118a61 @qiangxue prepare for next release.
qiangxue authored
2 ================================================
d61c80d prepare for next release.
qiang.xue authored
3
4 !!!IMPORTANT!!!
5
6 The following upgrading instructions are cumulative. That is,
7 if you want to upgrade from version A to version C and there is
8 version B between A and C, you need to following the instructions
9 for both A and B.
10
b600af6 @qiangxue prepare for 1.1.12 release.
qiangxue authored
11 General upgrade instructions
12 ----------------------------
d61c80d prepare for next release.
qiang.xue authored
13 - Make a backup.
14 - Clean up your 'assets' folder.
c4a089a @mdomba added .gitignore to exclude list
mdomba authored
15 - Replace 'framework' dir with the new one or point GIT to a fresh
d61c80d prepare for next release.
qiang.xue authored
16 release and update.
17 - Check if everything is OK, if not — revert from backup and post
18 issues to Yii issue tracker.
19
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
20 Upgrading from v1.1.12
21 ----------------------
036f6f2 @samdark Fixes #1548: Upgraded jQueryUI to 1.9.2
samdark authored
22 - Both jQuery and jQueryUI were updated. Check [jQuery UI upgrade guide](http://jqueryui.com/upgrade-guide/1.9/)
23 and [jQuery release notes](http://blog.jquery.com/2012/08/09/jquery-1-8-released/).
24
28b8d72 @cebe UPGRADE and CHANGELOG entry for #1549
cebe authored
25 - We completed the behavior of CFormatter::sizeFormat() which has been introduced in Yii 1.1.11. If you are using it with your own translation file
832ca3d @cebe Update UPGRADE
cebe authored
26 you have to move your translations to the `yii` category in `yii.php` file which is handled by the application component `coreMessages`.
27 We also fixed the default translation strings to be correct English and apply to choice format, so you have to adjust your translation file keys.
28b8d72 @cebe UPGRADE and CHANGELOG entry for #1549
cebe authored
28
879956b @mdomba Fixes #1406 allow storing of false return value from CDbCommand
mdomba authored
29 - Be sure to clean all your existing cache during the upgrade. The cache values from CDbCommand has been
738d800 @mdomba doc indent
mdomba authored
30 changed to an array to be able to store false values (returned when no records are found).
879956b @mdomba Fixes #1406 allow storing of false return value from CDbCommand
mdomba authored
31
bcaca7d @cebe UPGRADE comment on #1426
cebe authored
32 - Make sure all your event handlers in behaviors are public methods, as we are not supporting protected methods as event handlers anymore.
33
c3dc104 @cebe small enhancements to UPGRADE instructions
cebe authored
34 - We fixed the calls to CActiveRecord::beforeFind() for consistency so that beforeFind() now always gets called for every relation
35 on eager loading even if the main query does not return a result. This has been the case for all CActiveRecord::find*()-methods
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
36 already but now also applies for findBySql() and findAllBySql().
37
c3dc104 @cebe small enhancements to UPGRADE instructions
cebe authored
38 - Criteria modification in CActiveRecord::beforeFind() did not apply to the query when model was loaded in a relational context.
39 Since version 1.1.13 changes to query criteria made in beforeFind() now also apply to the query when model is loaded in a relational context.
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
40 The main problem here is that you can not use the `t`-alias for your table anymore, you have to change your code to
879956b @mdomba Fixes #1406 allow storing of false return value from CDbCommand
mdomba authored
41 use the table alias currently in use as this is different in relational context.
f63cb41 @cebe Update UPGRADE
cebe authored
42 You can get that alias by calling `$this->getTableAlias();` in your active record class
43 or `$this->owner->getTableAlias()` in behavior context.
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
44
45 Example:
46 $criteria->condition = 't.myfield = 1';
c3dc104 @cebe small enhancements to UPGRADE instructions
cebe authored
47 You need to change that to:
f63cb41 @cebe Update UPGRADE
cebe authored
48 $alias = $this->owner->getTableAlias();
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
49 $criteria->condition = $alias.'.myfield = 1';
50
51 Upgrading from v1.1.11
52 ----------------------
273e077 @suralc Updated UPDATE and CHANGELOG
suralc authored
53 - Changes in CCookieCollection::add() (introduced in 1.1.11) were reverted as they were triggering E_STRICT on some old PHP-versions
54 If your application relies on these newly added changes. You should change your code from
b253faa @samdark #1256 Added note about CActiveRecord::resetScope() signature change t…
samdark authored
55
56 $cookies->add(new CHttpCookie($name, $value));
273e077 @suralc Updated UPDATE and CHANGELOG
suralc authored
57 to
58 $cookies[$name] = new CHttpCookie($name, $value);
d61c80d prepare for next release.
qiang.xue authored
59
b253faa @samdark #1256 Added note about CActiveRecord::resetScope() signature change t…
samdark authored
60
61 - CActiveRecord::resetScope() method signature changed. Updated your subclasses that override resetScope() if any.
62
d4d756d prepare for next release.
qiang.xue authored
63 Upgrading from v1.1.10
64 ----------------------
610689a @steffendietz updated upgrade instructions, minor code style upgrade
steffendietz authored
65 - API of public method CConsoleCommand::confirm() changed. If you are overriding this method make sure to update your code.
66 The method now has a 2nd parameter for the default value which will be used if no selection is made, so you have to
67 adjust the signature to fit
ada1ced @samdark added CJavaScriptExpression while keeping BC
samdark authored
68
610689a @steffendietz updated upgrade instructions, minor code style upgrade
steffendietz authored
69 public function confirm($message,$default=false)
ada1ced @samdark added CJavaScriptExpression while keeping BC
samdark authored
70
610689a @steffendietz updated upgrade instructions, minor code style upgrade
steffendietz authored
71 and the parent call to
ada1ced @samdark added CJavaScriptExpression while keeping BC
samdark authored
72
610689a @steffendietz updated upgrade instructions, minor code style upgrade
steffendietz authored
73 parent::confirm($message,$default);
74
75 - API of protected method CConsoleCommand::afterAction() changed, if you are overriding this method make sure to update your code.
2feacc8 @cebe more verbose UPGRADE note
cebe authored
76 method now has a 3rd parameter for application exit code, so you have to adjust the signature to fit
ada1ced @samdark added CJavaScriptExpression while keeping BC
samdark authored
77
2feacc8 @cebe more verbose UPGRADE note
cebe authored
78 protected function afterAction($action,$params,$exitCode=0)
ada1ced @samdark added CJavaScriptExpression while keeping BC
samdark authored
79
2feacc8 @cebe more verbose UPGRADE note
cebe authored
80 and the parent call to
ada1ced @samdark added CJavaScriptExpression while keeping BC
samdark authored
81
2feacc8 @cebe more verbose UPGRADE note
cebe authored
82 parent::afterAction($action,$params,$exitCode);
d4d756d prepare for next release.
qiang.xue authored
83
2dfab97 @mdomba typo fix and upgrade note
mdomba authored
84 - CDateFormat::format() now will return null if the parameter $time is null. Previously it would return 1/1/1970.
85
ada1ced @samdark added CJavaScriptExpression while keeping BC
samdark authored
86 - If you are using CJavaScript::encode in your application with parameter coming
87 from user input, set second argument to true:
88
89 CJavaScript::encode($userInput, true);
90
91 It will disable prefixing parameters with "js:". If you need to pass JavaScript
92 expression it's now preferrable to wrap these with CJavaScriptExpression:
93
94 CJavaScript::encode(new CJavaScriptExpression('alert("Yii!");'), true);
95
96 Note that second "safe" parameter doesn't affect CJavaScriptExpression in any way.
97
98
38e2183 prepare for next release.
qiang.xue authored
99 Upgrading from v1.1.9
100 ---------------------
04aa9a5 (Fixes issue 3154) xSendFile - removed file existance check and added…
mdomba authored
101 - Previously xSendFile() was returning false if the file was not found.
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
102 This has been removed to allow relative file paths. If you are relying on this check,
103 you will need to do it manually before calling xSendFile().
38e2183 prepare for next release.
qiang.xue authored
104
d61c80d prepare for next release.
qiang.xue authored
105 Upgrading from v1.1.8
106 ---------------------
3e085ed (Fixed issue 2951) Removed CConfiguration::createObject, CController:…
alexander.makarow authored
107 - CConfiguration::createObject, CController::paginate and CHtml::getActiveId deprecated since 1.0.x were removed. Use
108 Yii::createComponent, new CPagination directly and CHtml::activeId respectively.
109
5bcb07f (Fixes issue 2647) Fixed inconvenient way of defining through relation.
alexander.makarow authored
110 - In CErrorHandler::handleException() the checking for ajax call has been removed
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
111 as it was preventing to customize the display of the exception during an ajax call.
65b9912 removed checking for ajax calls in CErrorHandler::handleException() -…
mdomba authored
112
38e2183 prepare for next release.
qiang.xue authored
113 - Previously in case of validation error the CSS "error" class was not added to the row container at all when
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
114 checkBoxList or radioButtonList where used. This is fixed now and proper "error" CSS class is added to the row
115 container but in case of validation error, all labels from the list are shown in red because of the CSS rule.
44d5e84 (fixes issue 1968) Fixed inconsistence in CActiveForm error highlight…
mdomba authored
116
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
117 To fix this and display only the attribute label in red:
44d5e84 (fixes issue 1968) Fixed inconsistence in CActiveForm error highlight…
mdomba authored
118
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
119 in <projectdir>/css/form.css the line:
44d5e84 (fixes issue 1968) Fixed inconsistence in CActiveForm error highlight…
mdomba authored
120
121 div.form div.error label
122
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
123 should be changed to
44d5e84 (fixes issue 1968) Fixed inconsistence in CActiveForm error highlight…
mdomba authored
124
125 div.form div.error label:first-child
126
e948444 updated UPGRADE note about through
alexander.makarow authored
127 - If you've used "through" ActiveRecord option in your relation definitions it's good to update code as shown below.
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
128 Old style of defining this option still works but is now deprecated.
5bcb07f (Fixes issue 2647) Fixed inconvenient way of defining through relation.
alexander.makarow authored
129
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
130 Change
5bcb07f (Fixes issue 2647) Fixed inconvenient way of defining through relation.
alexander.makarow authored
131
132 ~~~
133 class Group extends CActiveRecord
134 {
135 public function relations()
136 {
137 return array(
138 'roles'=>array(self::HAS_MANY,'Role','group_id'),
139 'users'=>array(self::HAS_MANY,'User','user_id','through'=>'roles'),
140 );
141 }
142 }
143 ~~~
144
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
145 to
5bcb07f (Fixes issue 2647) Fixed inconvenient way of defining through relation.
alexander.makarow authored
146
147 ~~~
148 class Group extends CActiveRecord
149 {
150 public function relations()
151 {
152 return array(
153 'roles'=>array(self::HAS_MANY,'Role','group_id'),
154 'users'=>array(self::HAS_MANY,'User',array('user_id'=>'id'),'through'=>'roles'),
155 );
156 }
157 }
158 ~~~
159
d61c80d prepare for next release.
qiang.xue authored
160
161 Upgrading from v1.1.7
162 ---------------------
163 - CDbAuthManager will now quote columns and tables referenced in its SQL code.
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
164 If your auth tables were created in a case-insensitive fashion (e.g. on PostgreSQL)
165 while your DBMS is case-sensitive, this change may cause DB query errors.
166 To fix this issue, you will have to rename the table names and columns, or re-create
167 the auth tables by following the SQL code given in framework/web/auth/*.sql.
d61c80d prepare for next release.
qiang.xue authored
168 - jQuery was upgraded to 1.6.1. Check your client side code and if you have issues consider
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
169 downgrading to 1.5.1 or 1.4.4.
d61c80d prepare for next release.
qiang.xue authored
170
171
172 Upgrading from v1.1.6
173 ---------------------
174 - Make sure you are using latest stable PHPUnit 3.5 if you are using unit tests.
175
176
177 Upgrading from v1.1.5
178 ---------------------
179 - In CActiveRecord::relations(), if a relation involves composite foreign keys, the foreign key
180 columns must be separated by commas now. Previously, the columns can be separated by either
181 commas or spaces. If your mode code are generated by Gii or yiic shell, you do not need to
182 worry about this.
183 - CLDR data was updated to a newest available version so data formats, month
184 names and other regional data can be changed.
185
186
187 Upgrading from v1.1.4
188 ---------------------
189 - CHtml will no longer render null attributes for HTML tags. This means if $htmlOptions is
190 array('class'=>null), it will no longer render the 'class' attribute in the HTML tag.
191 it would render the class attribute as class="". We expect this will not cause much trouble
192 in upgrading. However, in case problems happen, you may set the attribute to be an empty string
193 to solve them.
194
195 - Now by default CWebLogRoute does not render logs in FireBug for ajax calls.
196 To get logs rendered for ajax calls in FireBug set CWebLogRoute::ignoreAjaxInFireBug to false
197
198 - The implementation of CCache::flush() was changed a little. Child classes should now implement
199 a flushValues() method. If you use any custom cache class with flush functionality, you should
200 rename the flush method accordingly.
201
202 - The prompt and empty options used in CHtml methods will NOT be HTML-encoded anymore. It will now
203 always convert ">" and "<" into "&gt;" and "lt;", respectively. This should be sufficient in most
204 cases. But if your application uses some other special characters, or if you allow user inputs
205 to be used as prompt and empty text labels, please call CHtml::encode() explicitly on these option
206 values.
207
208
209 Upgrading from v1.1.3
210 ---------------------
211 - Zii was merged into Yii so if you are using SVN to keep framework
212 up to date, you'll need to delete 'framework/zii' and then update it.
213
214 Upgrading from v1.1.2
215 ---------------------
216 - When using the skin feature, you now need to explicitly configure
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
217 the 'enableSkin' property of 'widgetFactory' application component
218 to be true. Also, if you have configured the 'widgets' property, you
219 should rename it to be 'skinnableWidgets'. These changes are due to
220 the introduction of the global widget customization feature.
221 Please see the guide (the "Theming" section) for more details.
d61c80d prepare for next release.
qiang.xue authored
222
223 - CAutoComplete is now deprecated and will be removed in Yii 1.2. Consider
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
224 using CJuiAutoComplete.
d61c80d prepare for next release.
qiang.xue authored
225
226 - Now it's not possible to reuse CActiveFinder. So if you have code like this:
227
228 $finder = Post::model()->with('comments');
229 $posts1 = $finder->findAll();
230
231 $posts2 = $finder->findAll();
232
233 you should rewrite it to:
234
235 $posts1 = Post::model()->with('comments');
236
237 $posts2 = Post::model()->with('comments');
238
239 - The 'condition' declared in the scopes of the related AR classes will now
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
240 be put in the 'ON' clause of the JOIN statement when performing relational AR queries.
d61c80d prepare for next release.
qiang.xue authored
241
242
243 Upgrading from v1.1.1
244 ---------------------
245
246 Upgrading from v1.1.0
247 ---------------------
248 - CHtml::beginForm() will automatically generate hidden fields to represent
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
249 the parameters in the query string when the form uses GET method.
250 To avoid submitting duplicated query parameters, you may use createUrl()
251 to explicitly specify the action of the form. You may also need to remove
252 the hidden fields that you previously render for the same purpose.
d61c80d prepare for next release.
qiang.xue authored
253
254 - The code generated by yiic tool is changed. If you are using yiic tool
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
255 to generate new CRUD code on a previously generated skeleton, you are recommended
256 to run "yiic webapp" again to re-generate the skeleton. Make sure you backup
257 your work before you do this.
d61c80d prepare for next release.
qiang.xue authored
258
259 - CMenu now renders the 'active' CSS class for the 'li' tag instead of the
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
260 hyperlink tag. You should adjust your CSS code accordingly if you use CMenu
261 in your application.
d61c80d prepare for next release.
qiang.xue authored
262
263 - CUrlManager::parsePathInfo() is changed to be non-static. If you override
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
264 this method or your existing code calls this method directly (neither is common),
265 you need to change your code accordingly.
d61c80d prepare for next release.
qiang.xue authored
266
267 - CController::forward() will exit the application by default now. If you want
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
268 to keep the old behavior, you may pass false as the second parameter.
d61c80d prepare for next release.
qiang.xue authored
269
270 - The jQuery copy included in the framework has been upgraded to version 1.4.2.
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
271 This may cause some incompatibility problems to your existing jQuery code or plugins.
272 If you want to keep using version 1.3.2, you may do so by configuring
273 CClientScript::scriptMap property.
d61c80d prepare for next release.
qiang.xue authored
274
275 - The default theme for JQuery UI widgets was changed from 'smoothness' to 'base'.
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
276 If you are using 'smoothness', you will need to manually download this theme from
277 jqueryui.com and configure the 'theme' property of the JQuery UI widgets accordingly.
d61c80d prepare for next release.
qiang.xue authored
278
279
280 Upgrading from v1.1rc
281 ---------------------
282 - CRudColumn is renamed as CButtonColumn
283 - CDataColumn.dataField and dataExpression are renamed as name and value, respectively
284 - The alias name for the primary table in an AR query is fixed to be 't'
285
286 Upgrading from v1.1b
287 --------------------
288
289 Upgrading from v1.1a
290 --------------------
291 - CSort::attributes is changed. Now the array keys refer to attribute names
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
292 and array values refer to virtual attribute definitions. Please read the
293 API documentation for this property to learn more details. This change will
294 affect your code only when you explicitly specify this property.
d61c80d prepare for next release.
qiang.xue authored
295
296 Upgrading from v1.0.x
297 ---------------------
298 - Application and module parameter names are changed to be case-sensitive.
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
299 In 1.0.x, they are case-insensitive.
d61c80d prepare for next release.
qiang.xue authored
300
301 - For tabular input, using Field[$i] is not valid anymore. Attribute names
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
302 should look like [$i]Field in order to support array-typed fields
303 (e.g. [$i]Field[$index]).
d61c80d prepare for next release.
qiang.xue authored
304
305 - Please read the Guide for further details on how to upgrade from v1.0.x to v1.1.
306
307 Upgrading from v1.0.12
308 ----------------------
309
310 Upgrading from v1.0.11
311 ----------------------
312
313 Upgrading from v1.0.10
314 ----------------------
315
316 Upgrading from v1.0.9
317 ---------------------
318
319 Upgrading from v1.0.8
320 ---------------------
321 - ActiveRecord lazy loading is changed for optimization purpose. Previously,
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
322 when lazy loading occurs, the related table will be joined with the primary
323 table. Now, the related table will be queried without joining the primary table.
324 As a result, if you are using lazy loading and the corresponding relation
325 declaration includes reference to the primary table, the query will fail.
326 To fix this problem, please specify the lazy loading query options with the
327 actual primary table column values.
d61c80d prepare for next release.
qiang.xue authored
328
329 Upgrading from v1.0.7
330 ---------------------
331 - A directory imported using Yii::import() will have precedence over
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
332 any existing include paths. For example, if we import 'application.models.*',
333 then the corresponding directory will be searched before any other
334 existing include paths. This also means, a directory imported later will
335 have precedence over directories imported earlier. Previously, this order
336 was reversed. This change may affect you if you have several classes with
337 the same name and they are imported via different directories. You will need
338 to adjust the import order of these directories to make sure your existing
339 applications are not broken due to this change.
d61c80d prepare for next release.
qiang.xue authored
340
341
342 Upgrading from v1.0.6
343 ---------------------
344 - Default named scope will no longer be applied to INSERT, UPDATE and
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
345 DELETE queries. It is only applied to SELECT queries. You should be aware
346 of this change if you override CActiveRecord::defaultScope() in your code.
d61c80d prepare for next release.
qiang.xue authored
347
348 - The signature of CWebUser::logout() is changed. If you override this method,
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
349 you will need to modify your method declaration accordingly.
d61c80d prepare for next release.
qiang.xue authored
350
351
352 Upgrading from v1.0.5
353 ---------------------
354
355
356 Upgrading from v1.0.4
357 ---------------------
358 - CWebUser::checkAccess() takes an additional parameter to allow caching
21da317 @cebe added UPGRADE note for beforeFind() relational criteria
cebe authored
359 the access check results. If you override this method, you will need to
360 modify your method declaration accordingly. Because the new parameter will
361 enable caching the access check results by default, please double check
362 your code containing this method call to make sure the behavior is as expected.
d61c80d prepare for next release.
qiang.xue authored
363
364 - CDateParser has been renamed to CDateTimeParser
365
366
367 Upgrading from v1.0.3
368 ---------------------
369 - The signature of CWebModule::init() is modified. Its parameter is removed.
370 If your application uses modules, you have to modify your module class
371 files accordingly.
372
373
374 Upgrading from v1.0.2
375 ---------------------
376 - Controllers that are organized in subdirectories are now referenced
377 using the ID format "path/to/xyz". Previously it was "path.to.xyz".
378 If you use "path.to.xyz" in your application, you have to modify it
379 to "path/to/xyz".
380
381 - CHtml::coreScript() is removed. If you used this in your application,
382 please use the following alternative:
383
384 Yii::app()->clientScript->registerCoreScript($name);
385
386
387 Upgrading from v1.0.1
388 ---------------------
389 - Due to the introduction of the scenario-based massive assignment feature,
390 we removed CActiveRecord::protectedAttributes(). Please use safeAttributes()
391 to specify which attributes are safe to be massively assigned.
392
393 For more details about scenario-based assignment and validation,
394 please read the following tutorial section:
395
396 http://www.yiiframework.com/doc/guide/form.model#securing-attribute-assignments
397
398 - The signature of CModel::validate() has been changed to:
399
400 CModel::validate($scenario='', $attributes=null)
401
402 That is, the order of the two parameters has been swapped. If your application
403 contains code that invokes the validate() method (of either a CFormModel
404 or a CActiveRecord object) with some parameter, please make sure you fix
405 the parameter order.
406
407 - The usage of CActiveRecord::with() and the 'with' option in relations
408 has been changed. In order to query child relations, we should specify the 'with'
409 parameter/option like the following now:
410
411 Post::model()->with(array('comments', 'author.profile'))->findAll();
412
413 Previously, this should be written as:
414
415 Post::model()->with(array('comments', 'author'=>'profile'))->findAll();
416
417 If your code does not involve child relations (like 'profile' in the above),
418 nothing needs to be changed.
419
420 This change has been introduced in order to support dynamic relational
421 query options. For example, we can specify that comments be sorted in
422 descending order (assuming in the relations() method it is specified as
423 ascending order):
424
425 Post::model()->with(array(
426 'comments'=>array('order'=>'createTime DESC'),
427 'author.profile',
428 ))->findAll();
429
430
431 Upgrading from v1.0.0
432 ---------------------
433 - An $scenario parameter is added to both CModel::beforeValidate() and afterValidate().
434 If you override these methods in your child classes (form models, AR classes),
435 make sure you change the method signature accordingly.
Something went wrong with that request. Please try again.