* With this function we find the number of posts and topics in a given forum.
*
* @todo consider to call this function only once and let it return an array where the key is the forum id and the value is an array with number_of_topics and number of post
* as key of this array and the value as a value. This could reduce the number of queries needed (especially when there are more forums)
* @todo consider merging both in one query.
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version february 2006, dokeos 1.8
*
* @deprecated the counting mechanism is now inside the function get_forums
* Gets the real course id based on the course id field name and value. Note that if the course id field name is "chamilo_course_id", it will use the course id
* Gets the real course id based on the course id field name and value.
* Note that if the course id field name is "chamilo_course_id", it will use the course id
* in the system database
*
* @param string Course id field name
* @param string Course id value
* @return mixed System course id if the course was found, WSError otherwise
*/
protected function getCourseId($course_id_field_name, $course_id_value) {
protected function getCourseId($course_id_field_name, $course_id_value)
* Gets the real session id based on the session id field name and value. Note that if the session id field name is "chamilo_session_id", it will use the session id
* Gets the real session id based on the session id field name and value.
* Note that if the session id field name is "chamilo_session_id", it will use the session id
* in the system database
*
* @param string Session id field name
@ -264,7 +274,8 @@ class WSCM {
*
* @param WSError Error
*/
protected function handleError($error) {
protected function handleError($error)
{
$handler = WSCMError::getErrorHandler();
$handler->handle($error);
}
@ -274,7 +285,8 @@ class WSCM {
*
* @return array Array with a code of 0 and a message 'Operation was successful'
*/
protected function getSuccessfulResult() {
protected function getSuccessfulResult()
{
return array('code' => 0, 'message' => 'Operation was successful');
}
@ -283,18 +295,19 @@ class WSCM {
*
* @return string Success
*/
public function test() {
public function test()
{
return "success";
}
/**
* *Strictly* reverts PHP's nl2br() effects (whether it was used in XHTML mode or not)
@ -303,20 +303,6 @@ class TestForumFunction extends UnitTestCase {
//var_dump($res);
}
/**
* This function retrieves all the information of a given forum_id
* @param $forum_id integer that indicates the forum
* @return array returns
* @deprecated this functionality is now moved to get_forums($forum_id)
*/
/*
function testget_forum_information() {
$forum_id = 1;
$res = get_forum_information($forum_id);
$this->assertTrue(is_array($res));
//var_dump($res);
}*/
/**
* This function retrieves all the information of a given forumcategory id
* @param $forum_id integer that indicates the forum
@ -514,28 +500,7 @@ class TestForumFunction extends UnitTestCase {
}
//var_dump($res);
}
/**
* With this function we find the number of posts and topics in a given forum.
* @param int
* @return array
* @todo consider to call this function only once and let it return an array where the key is the forum id and the value is an array with number_of_topics and number of post
* as key of this array and the value as a value. This could reduce the number of queries needed (especially when there are more forums)
* @todo consider merging both in one query.
* @deprecated the counting mechanism is now inside the function get_forums
*/
/*
function testget_post_topics_of_forum() {
$forum_id = 1;
$res = get_post_topics_of_forum($forum_id);
if(!is_null($res)){
$this->assertTrue(is_array($res));
} else {
$this->assertTrue(is_null($res));
}
//var_dump($res);
}*/
/**
* Retrieve all posts of a given thread
* @param int $thread_id integer that indicates the forum