To work with objects you need to select all the columns that define the object like class_key, context_key, id (primary key), etc. If you just want raw column values back from the table, you do not need to use objects however.
To use objects though, here is how it would be done.
<?php
$c = $modx->newQuery('modResource', array('id' => 1));
$c->select($modx->getSelectColumns('modResource','','',array('id', 'pagetitle', 'class_key', 'context_key')));
$collection = $modx->getCollection('modResource', $c);
foreach ($collection as $object) {
var_dump($object->get(array('id', 'pagetitle')));
}
Note that this would only ever return one object though, since you are selecting it where the primary key id = 1.
Also note, you never want to var_dump a collection of xPDOObjects (there are references that will recurse) or even an xPDOObject; use the toArray() method or get() method to output specific column values.
Without instantiating an object for each row, you can do this:
<?php
$c = $modx->newQuery('modResource', array('deleted' => false));
$c->select($modx->getSelectColumns('modResource','','',array('id', 'pagetitle')));
if ($c->prepare() && $c->stmt->execute()) {
while ($row = $c->stmt->fetch(PDO::FETCH_ASSOC)) {
var_dump($row);
}
}