Category Covered

Cakephp containable conditions in pagination

cakephp containable with complex condition, limit on related model.

$this->paginate = array(
	 'limit' => 20,
	 'order' => array('NiteParty.date' => 'ASC'),
	'contain' => array(
		'Item' => array(
		       'conditions' => array(
		          'Item.id' => 3
		       ),
			'limit' => 2,
		 ),
		'NitePartyPicture' => array(
			'limit' => 3,
		)
	)
);
		
		
		
		
		$niteparties = $this->paginate();