Answer the question
In order to leave comments, you need to log in
How to set limit and offset in CDbCriteria with with in Yii?
I have categories and articles, the article has a relation 'Irelations'=>array(self::HAS_MANY, 'VPRelation', 'post_id'),
I get all articles from the category
$Criteria = new CDbCriteria(array(
'with' => array(
'Irelations' => array(
'select' => '*',
'joinType' => 'INNER JOIN',
'condition' => 'Irelations.category_id=' . $Category->id,
),
),
'order' => 't.publicated DESC',
'condition' => 't.status='.VP::StatusActive.' or t.status = '.VP::StatusActivePending,
));
$Allnodes = VPost::model()->findAll($Criteria );
$countAllnodes = count(VPost::model()->findAll($Criteria ));
at the same time all received records are loaded into memory? Or is the quantity calculated only from the meta?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question