Improve user profile

This commit is contained in:
Eike Foken
2011-09-21 02:05:10 +02:00
parent b792faf9b0
commit 76f3134756
6 changed files with 46 additions and 4 deletions

View File

@@ -159,6 +159,19 @@ class Experiment extends CI_Model {
return $query->result_array();
}
/**
* Counts all experiments.
*
* @param string $userId
* @return integer
*/
public function count($userId = false) {
if ($userId) {
$this->db->where('creator_id', $userId);
}
return $this->db->count_all_results('experiments');
}
/**
* Search for a specific experiment and return a list of possible results.
*

View File

@@ -145,6 +145,19 @@ class Project extends CI_Model {
return $this->_addShortNames($result);
}
/**
* Counts all projects.
*
* @param string $userId
* @return integer
*/
public function count($userId = false) {
if ($userId) {
$this->db->where('owner', $userId);
}
return $this->db->count_all_results('projects');
}
/**
* Counts all experiments for the specified project.
*