Skip to content

Instantly share code, notes, and snippets.

@poisa
Created December 10, 2013 20:32
Show Gist options
  • Save poisa/7898032 to your computer and use it in GitHub Desktop.
Save poisa/7898032 to your computer and use it in GitHub Desktop.
public function getConfigFromDb()
{
if (!is_null($this->configInDb)) {
return $this->configInDb;
}
$sql = new Sql($this->getSlaveDbAdapter());
$select = $sql->select()
->from('languages');
$statement = $sql->prepareStatementForSqlObject($select);
$results = $statement->execute();
$results->buffer();
$return = array();
foreach ($results as $r) {
$return[] = $r;
}
$this->configInDb = $return;
return $return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment