|
|
|
i think the course category should be passed by unique identifier (id, name), and have functions, like add_course, to course_categories too (I.E. add_course_category, delete_course_category, ... )
If no category parameter not specified, pass to a default category (0) ... In the function thats remove a course_category, could have a flag(true/false), like cascade, thats set to do a delete cascade, removing all courses with associate couse_categories if it's set to true, the default could be false. This funcionality is completed in CVS.
We have commit a simpletest. |
||||||||||||||||||||||||||||||||||||||||||
/**
* Adds a new course to the course table
*
* @private ?
*
* @param array $course
* $course format:
* <ul>
* <li>$course[name]</li>
* <li>$course[shortname]</li>
* <li>$course[format]</li>
* <li>$course[idnumber]</li>
* <li>$course[category]</li>
* </ul>
*
* @return int|boolean new course id or false
*/
function add_course($course){
}
/**
* Adds several new courses to the course table
*
* @param array $courses
* $courses format
* <ul>
* <li>$courses[i][name]</li>
* <li>$courses[i][shortname]</li>
* <li>$courses[i][format]</li>
* <li>$courses[i][idnumber]</li>
* <li>$courses[i][category]</li>
* </ul>
*
* @uses add_course
*
* @return array|boolean array containing new courses ids or false
*/
function add_courses($courses){
}