Use a global style scheme

Controllers: underscores
Models: CamelCase
This commit is contained in:
Karsten Heiken
2011-04-22 03:44:23 +02:00
parent cf00dcf39b
commit 06c96140dc
5 changed files with 8 additions and 8 deletions

View File

@@ -57,7 +57,7 @@ class Jobs extends CI_Controller {
* @todo not yet verified
*/
public function get_unseen_results() {
$results = $this->job->get_unseen_results();
$results = $this->job->getUnseenResults();
$this->output
->set_content_type('application/json')
->set_output(json_encode(

View File

@@ -44,6 +44,6 @@ class Statusrpc extends CI_Controller {
die("Unauthorized access.");
}
$this->server->update_workload($secret, $workload);
$this->server->updateWorkload($secret, $workload);
}
}

View File

@@ -24,7 +24,7 @@ class Job extends CI_Model {
/**
* Get a list of results that the owner has not yet seen.
*/
public function get_unseen_results() {
public function getUnseenResults() {
$query = $this->db->order_by('started_at', 'asc')
->get_where('jobs', array('started_by' => $this->session->userdata('user_id'), 'seen' => '0'));
$jobs = $query->result_array();

View File

@@ -102,7 +102,7 @@ class Project extends CI_Model {
*
* @param array $project_id The project to get the configuration from.
*/
public function get_configurations($project_id) {
public function getConfigurations($project_id) {
$query = $this->db->get_where('configurations', array('project_id' => $project_id));
$configurations = $query->result_array();

View File

@@ -10,7 +10,7 @@ class Server extends CI_Model {
*
* @return array List of all available servers.
*/
public function get_all() {
public function getAll() {
return $this->db->get('servers')->result_array();
}
@@ -19,7 +19,7 @@ class Server extends CI_Model {
*
* @return array List of servers that could handle another job.
*/
public function get_idle() {
public function getIdle() {
return $this->db->get_where('servers', 'workload <= 2')->result_array();
}
@@ -32,7 +32,7 @@ class Server extends CI_Model {
* @param type $secret The server's secret for basic authentication.
* @param type $workload The server's workload.
*/
public function update_workload($secret, $workload) {
public function updateWorkload($secret, $workload) {
$this->db->query("UPDATE `servers` SET `workload`=".$this->db->escape($workload)
. ", `last_update`=NOW()"
. " WHERE `secret`=".$this->db->escape($secret));
@@ -43,7 +43,7 @@ class Server extends CI_Model {
*
* @todo not yet verified.
*/
public function get_best_server() {
public function getBestServer() {
return $this->db->limit(1)->order_by('last_update', 'desc')->
get_where('servers', 'workload <= 2')->row_array();
}