CdbCriteria - loading "with()" with "attributes" instead of condition and params

Hello all together,

today I had kind of a problem using lazy-loading.

I solved this problem with an in my opinion unlucky way - see as following:

$menue = Menue::model()->with(array(

	'items' => array(

		'order'		=> 'position ASC',

		'condition'	=> 'language_id = :lang && parent_item_id = :parent_id',

		'params'	=> array(

			'lang'		=> self::get()->language_id,

			'parent_id'	=> $parent_id,




	'domain_id'	=> CurrentDomain::get()->id,

	'identifier'	=> $identifier,


How could I do it better? Is it possible to define “attributes” within “with()”? Tryd that but it didn’t work.

Hoping for an answer :)

Kind regards, Dominik

hi, :)

can you give the sample code for lazy loading ?

hello :),

somehow I’m iritated now - it’s all about the code I attached to my last post - can’t you see it?