Skip to content

Commit d2d81fe

Browse files
committed
exclude relations with limit/offset
exclude them until we have a well defined behavior to handle them
1 parent 7cd1d9e commit d2d81fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

EActiveRecordRelationBehavior.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,14 @@ public function afterSave($event)
243243
protected function isRelationSupported($relation)
244244
{
245245
// @todo not sure about 'together', also check for joinType
246-
// @todo not sure what to do if limit/offset is set
247246
return !isset($relation['on']) &&
248247
!isset($relation['through']) &&
249248
!isset($relation['condition']) &&
250249
!isset($relation['group']) &&
251250
!isset($relation['join']) &&
252251
!isset($relation['having']) &&
252+
!isset($relation['limit']) && // @todo not sure what to do if limit/offset is set
253+
!isset($relation['offset']) &&
253254
!isset($relation['scopes']);
254255
}
255256

@@ -282,7 +283,7 @@ protected function objectsToPrimaryKeys($records)
282283
*/
283284
protected function primaryKeysToObjects($pks, $className)
284285
{
285-
// @todo increase performance by running on query with findAllByPk()
286+
// @todo increase performance by running one query with findAllByPk()
286287
$records=array();
287288
foreach($pks as $pk) {
288289
$record=$pk;

0 commit comments

Comments
 (0)