public function applyStrategy($options, $context)
{
if ($context->type() !== 'read') {
return;
}
$options += array('strategy' => 'joined');
if (!($model = $context->model())) {
throw new ConfigException('The `\'with\'` option need a valid `\'model\'` option.');
}
$strategy = $options['strategy'];
if (isset($this->_strategies[$strategy])) {
$strategy = $this->_strategies[$strategy];
$strategy($this, $model, $context);
} else {
throw new QueryException("Undefined query strategy `{$strategy}`.");
}
}