Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 6 additions and 6 deletions.
  1. +3 −2 controllers/BaseController.php
  2. +3 −4 models/BaseModel.php
View
5 controllers/BaseController.php
@@ -104,8 +104,9 @@ protected function _options($defaults = array()) {
$options[$key] = (is_numeric($val)) ? (int)$val : $val;
}
}
- if (!empty($this->request->get)) {
- $options += $this->request->get;
+ if (!empty($this->request->query)) {
+ $options += $this->request->query;
+ unset($options['url']);
}
$options = array_merge($defaults, $options);
return $options;
View
7 models/BaseModel.php
@@ -304,7 +304,7 @@ public function resolve($entity, $fields = null) {
break;
}
- $return = true;
+ $return = null;
foreach ($fields as $field) {
if (preg_match('/^(.+)_id$/', $field, $matches)) {
list($attribute, $name) = $matches;
@@ -318,10 +318,9 @@ public function resolve($entity, $fields = null) {
continue;
}
$res = $model::first($id);
- if (!$res) {
- continue;
+ if ($res) {
+ $return = $entity->$name = $res;
}
- $return = $entity->$name = $res;
}
}
return (count($fields) > 1) ? $entity : $return;

No commit comments for this range

Something went wrong with that request. Please try again.