3

Is there a way in recess framework to do a SELECT mycolumn1, mycolumn2 and not a SELECT * on the Model. I only find the $this->model->select() function and it not allowing that.

Thank you,

recess-new
  • 31
  • 1

1 Answers1

2

The Recess framework is designed to return an object model when you try to query the database. So you are stuck with the select *, because every property of the object must be returned. It is possible to get around this if you access the PDO itself. For example:

$results = Databases::getSource('dataSourceName');
$set = $results->query("SELECT col1, col2 FROM table");

This will give you resultsSet object that you can iterate through. You won't be able to use the ->insert() and ->equal() and other wrapper methods on that object though.

ryanday
  • 2,506
  • 18
  • 25