Why not just return multiple statements, instead of switching the statement entirely? Something like:
```
$to_return = array();
$to_return[] = <<<EOQ
?object ?collection_predicate <info:fedora/!pid> ;
        <fedora-model:label> ?title ;
        <fedora-model:hasModel> !model 
EOQ;

if ($type == 'view') {
  $to_return[] = '?object <fedora-model:state> <fedora-model:Active>';
}
return $to_return;
```