Update:
I found a solution to the problem. I created a function in my ShardedActiveRecord class that generates a custom CActiveRecord and returns it. Here is how it looks:
public function getMergedDataProvider($back){
$modelArray = array();
$model = array();
$now = date("Ym");
for($i=0; $i<$back; $i++){
array_push($modelArray, $this->model()->setShard(date("Ym", strtotime("-".$i." month", strtotime($now))))->findAll());
}
foreach($modelArray as $ma){
$model = array_merge($model, $ma);
}
$dataProvider = new CActiveDataProvider(get_class($this), array(
'data'=>$model,
));
return $dataProvider;
}
I added a parameter that will allow me to go get the last 3 table shards (they are relative to a date).
In an action that requires the use of a sharded model, I can call the function as so, and use it as a normal CActiveDataProvider:
$dataProvider = MyModel::model()->getMergedDataProvider(3);
I hope this will help someone!