Skip to content
Permalink
Browse files

Removed duplicate variable

  • Loading branch information...
lorenzo committed Jun 10, 2013
1 parent 536d2cb commit 331b65daf6c563f0f1aae4748fc9e5fb79893a68
@@ -235,10 +235,9 @@ protected function _buildQuery($options) {
if (!empty($options['fields'])) {
$fields = $fetchQuery->aliasFields($options['fields'], $alias);
$required = $pivotAlias . '.' . $options['foreignKey'];
if (!in_array($required, $fields)) {
if (!in_array($key, $fields)) {
throw new \InvalidArgumentException(
sprintf('You are required to select the "%s" field', $required)
sprintf('You are required to select the "%s" field', $key)
);
}
$fetchQuery->select($fields);
@@ -179,10 +179,9 @@ protected function _buildQuery($options) {
if (!empty($options['fields'])) {
$fields = $fetchQuery->aliasFields($options['fields'], $alias);
$required = $alias . '.' . $options['foreignKey'];
if (!in_array($required, $fields)) {
if (!in_array($key, $fields)) {
throw new \InvalidArgumentException(
sprintf('You are required to select the "%s" field', $required)
sprintf('You are required to select the "%s" field', $key)
);
}
$fetchQuery->select($fields);

0 comments on commit 331b65d

Please sign in to comment.
You can’t perform that action at this time.