Skip to content

Commit

Permalink
Update GetListIn.php
Browse files Browse the repository at this point in the history
Code QC
  • Loading branch information
smg6511 committed Dec 12, 2024
1 parent c02646b commit d2ab7a1
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions core/src/Revolution/Processors/Security/User/Setting/GetListIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@

namespace MODX\Revolution\Processors\Security\User\Setting;

use MODX\Revolution\Processors\Model\GetProcessor;
use MODX\Revolution\modUserSetting;

/**
* Gets a list of user settings given an array of keys to search for
* @param integer $user The user to grab from
* @param integer $start (optional) The record to start at. Defaults to 0.
* @param integer $limit (optional) The number of records to limit to. Defaults to 10.
* @param string $sort (optional) The column to sort by. Defaults to key.
* @param string $dir (optional) The direction of the sort. Defaults to ASC.
*
* @property int $user The user to filter by
* @property string $keys A json-formatted list of settings keys to additionally filter by
* @package MODX\Revolution\Processors\Security\User\Setting
*/
class GetListIn extends \MODX\Revolution\Processors\System\Settings\GetList
Expand All @@ -45,20 +42,11 @@ public function prepareCriteria()
{
$criteria = [];
$criteria[] = ['user' => (int)$this->getProperty('user')];

Check warning on line 44 in core/src/Revolution/Processors/Security/User/Setting/GetListIn.php

View check run for this annotation

Codecov / codecov/patch

core/src/Revolution/Processors/Security/User/Setting/GetListIn.php#L43-L44

Added lines #L43 - L44 were not covered by tests
// $msg = "\r\n prepareCriteria, \$properties:\r\n" . print_r($this->getProperties(), true);
// $this->modx->log(\modX::LOG_LEVEL_ERROR, $msg, '', __CLASS__);

if ($keys = $this->getProperty('keys', '')) {
$keys = json_decode($keys);
// $this->modx->log(
// \modX::LOG_LEVEL_ERROR,
// "\r\t prepareCriteria:
// \t\t\$var1: {none}
// \t\t\$keys: " . print_r($keys, true)
// );
$criteria[] = ['key:IN' => $keys];

Check warning on line 48 in core/src/Revolution/Processors/Security/User/Setting/GetListIn.php

View check run for this annotation

Codecov / codecov/patch

core/src/Revolution/Processors/Security/User/Setting/GetListIn.php#L46-L48

Added lines #L46 - L48 were not covered by tests
}
return $criteria;

Check warning on line 50 in core/src/Revolution/Processors/Security/User/Setting/GetListIn.php

View check run for this annotation

Codecov / codecov/patch

core/src/Revolution/Processors/Security/User/Setting/GetListIn.php#L50

Added line #L50 was not covered by tests
}

}

0 comments on commit d2ab7a1

Please sign in to comment.