Pass Cdbcriteria Object To A Cconsolecommand

its possible to call a cconsole command from a controller/action?? and pass a cdbcriteria object argument to the command?

Yes it is:

$commandRunner = new CConsoleCommandRunner();

$commandRunner->commands = array(

  'mycommand' => array(

	'class' => '',



$commandRunner->run(array(null, 'mycommand', $argument1, $argument2));

I don’t think so. Arguments must be strings. Maybe you can build your criteria, convert it to array, serialize the array and pass it to the command, where it can be unserialized and used to re-create criteria object.

EDIT: CConsoleCommand has no "interactive" property, removed it from example code.