<commit_before><?php

/**
 * Created by PhpStorm.
 * User: Riza
 * Date: 5/29/14
 * Time: 8:00 PM
 */
class Tutor extends User
{
	private $major;
	private $teachingCourses;
	private $notTeachingCourses;

	/**
	 * Constructor
	 * @param $database
	 */
	public function __construct($data, $db) {
		parent::__construct($data, $db);
	}

	/**
	 * @return mixed
	 */
	public function getNotTeachingCourses() {
		if (!isset($this->notTeachingCourses)) {
			$this->notTeachingCourses = $this->retrieveCoursesNotTeaching();
		}
		return $this->notTeachingCourses;

	}

	/**
	 * @param mixed $notTeachingCourses
	 */
	public function setNotTeachingCourses($notTeachingCourses) {
		$this->notTeachingCourses = $notTeachingCourses;
	}

	public function retrieveCoursesNotTeaching() {
		$query = "
			SELECT course.code AS 'Code', course.name AS 'Name',  course.id
				FROM  `" . DB_NAME . "`.course
				WHERE NOT EXISTS (
					SELECT `course_id` FROM `sass-ms`.`tutor_teaches_course` WHERE course.id = `tutor_teaches_course`.`course_id`
				);
			";

		try {
			$query = $this->getDb()->getConnection()->prepare($query);
			$query->execute();
			return $query->fetchAll(PDO::FETCH_ASSOC);

		} catch (PDOException $e) {
			throw new Exception("Could not retrieve courses data from database.");
		}
	}

	/**
	 * @return mixed
	 */
	public function getMajor() {<commit_msg>Fix bug: using DB_NAME<commit_after><?php

/**
 * Created by PhpStorm.
 * User: Riza
 * Date: 5/29/14
 * Time: 8:00 PM
 */
class Tutor extends User
{
	private $major;
	private $teachingCourses;
	private $notTeachingCourses;

	/**
	 * Constructor
	 * @param $database
	 */
	public function __construct($data, $db) {
		parent::__construct($data, $db);
	}

	/**
	 * @return mixed
	 */
	public function getNotTeachingCourses() {
		if (!isset($this->notTeachingCourses)) {
			$this->notTeachingCourses = $this->retrieveCoursesNotTeaching();
		}
		return $this->notTeachingCourses;

	}

	/**
	 * @param mixed $notTeachingCourses
	 */
	public function setNotTeachingCourses($notTeachingCourses) {
		$this->notTeachingCourses = $notTeachingCourses;
	}

	public function retrieveCoursesNotTeaching() {
		$query = "SELECT course.code AS 'Code', course.name AS 'Name',  course.id
					FROM  `" . DB_NAME . "`.course
					WHERE NOT EXISTS (
						SELECT `course_id` FROM  `" . DB_NAME . "`.`tutor_teaches_course` WHERE course.id = `tutor_teaches_course`.`course_id`
					)";

		try {
			$query = $this->getDb()->getConnection()->prepare($query);
			$query->execute();
			return $query->fetchAll(PDO::FETCH_ASSOC);

		} catch (PDOException $e) {
			throw new Exception("Could not retrieve courses data from database.");
		}
	}

	/**
	 * @return mixed
	 */
	public function getMajor() {
{'fraction_non_alphanumeric': 0.14976199194434273, 'fraction_numerical': 0.005858659831563529, 'mean_word_length': 3.7762237762237763, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '799319', 'n_tokens_mistral': 1079, 'n_tokens_neox': 928, 'n_words': 198}