Improve user profile
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user