Exemplo n.º 1
0
 /**
  * Constructor.
  * 
  * @param string $version The backup version.
  * @param resource $db The database handler.
  * @param int $course_id The ID of this course.
  * @param string $import_dir The directory where the backup was unzipped to.
  * @param array $old_id_to_new_id Reference to either the parent ID's or to store current ID's.
  * 
  */
 function ContentTable($version, $db, $course_id, $import_dir, &$old_id_to_new_id)
 {
     // special case for `content` -- we need the max ordering
     $sql = 'SELECT MAX(ordering) AS ordering FROM ' . TABLE_PREFIX . 'content WHERE content_parent_id=0 AND course_id=' . $course_id;
     $result = mysql_query($sql, $db);
     $ordering = mysql_fetch_assoc($result);
     $this->ordering = $ordering['ordering'] + 1;
     parent::AbstractTable($version, $db, $course_id, $import_dir, $old_id_to_new_id);
 }