Quote from: BobRay at Aug 19, 2014, 11:27 PMIs there a similar method for getting the values of multiple fields without getting the object?
And what about getting values from multiple objects without getting the objects themselves?
You can just build the queries and get the raw result set from xPDOCriteria, xPDOQuery, or any PDOStatement via the PDO methods which xPDO wraps...
$stmt = $modx->prepare("SELECT food, beer, wine FROM bar WHERE active = 1");
if ($stmt->execute()) {
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
}
$query = $modx->newQuery("modResource");
$query->select(array(
'id' => 'id',
'class' => 'class_key',
'context' => 'context_key',
'published' => 'published'
));
if ($query->prepare() && $query->stmt->execute()) {
$results = $query->stmt->fetchAll(PDO::FETCH_ASSOC);
}