Multiple "with" criteria

Hello everybody,

I have a problem about 2 compare-with in the same CDbCriteria.

I wrote something like that:




$criteria->with = array('city'=>array('select'=>'name_city','together'=>true));

$criteria->with = array('clinic'=>array('select'=>'name_clinic','together'=>true));



But the second “with” overwrites the first “with” and doesn’t work.

Can you guys help me?

Thank you in advance.

merge them into one array like so


<?php

$criteria->with = array(

    'city'=>array('select'=>'name_city','together'=>true), 

    'clinic'=>array('select'=>'name_clinic','together'=>true)

);

Thank you so much. Works perfect! :)