<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Tucker
 * Date: 4/30/2017
 * Time: 8:00 PM
 */

/**
 * inserts this Favorite into mySQL
 *
 * @param \PDO $pdo PDO connection object
 * @throws \PDOException when mySQL related errors occur
 * @throws \TypeError if $pdo is not a PDO connection object
 **/
public function insert(\PDO $pdo): void {
	// enforce the favoriteProductId is null (i.e., don't insert a favorite that already exists)
	if($this->favoriteProductId !== null) {
		throw(new \PDOException("not a new favorite"));
	}
	// create query template
	$query = "INSERT INTO favorite(favoriteProfileId, favoriteProductId, favoriteDate) VALUES(:tweetProfileId, :tweetContent, :tweetDate)";
	$statement = $pdo->prepare($query);
	// bind the member variables to the place holders in the template
	$formattedDate = $this->favoriteDate->format("Y-m-d H:i:s.u");
	$parameters = ["favoriteProfileId" => $this->favoriteProfileId, "favoriteProductId" => $this->favoriteProductId, "favoriteDate" => $formattedDate];
	$statement->execute($parameters);
	// update the null favoriteProductId with what mySQL just gave us
	$this->favoriteProductIdId = intval($pdo->lastInsertId());
}

/**
 * deletes this Favorite from mySQL
 *
 * @param \PDO $pdo PDO connection object
 * @throws \PDOException when mySQL related errors occur
 * @throws \TypeError if $pdo is not a PDO connection object
 **/
public function delete(\PDO $pdo): void {
	// enforce the favoriteProductId is not null (i.e., don't delete a tweet that hasn't been inserted)
	if($this->favoriteProductId === null) {
		throw(new \PDOException("unable to delete a tweet that does not exist"));
	}
	// create query template
	$query = "DELETE FROM favorite WHERE favoriteProductId = :favoriteProductId";
	$statement = $pdo->prepare($query);<commit_msg>Pushed data-design.svg (conceptual model)<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Tucker
 * Date: 4/30/2017
 * Time: 8:00 PM
 */

/**
 * inserts this Favorite into mySQL
 *
 * @param \PDO $pdo PDO connection object
 * @throws \PDOException when mySQL related errors occur
 * @throws \TypeError if $pdo is not a PDO connection object
 **/
public function insert(\PDO $pdo): void {
	// enforce the favoriteProductId is null (i.e., don't insert a favorite that already exists)
	if($this->favoriteProductId !== null) {
		throw(new \PDOException("not a new favorite"));
	}
	// create query template
	$query = "INSERT INTO favorite(favoriteProfileId, favoriteProductId, favoriteDate) VALUES(:tweetProfileId, :tweetContent, :tweetDate)";
	$statement = $pdo->prepare($query);
	// bind the member variables to the place holders in the template
	$formattedDate = $this->favoriteDate->format("Y-m-d H:i:s.u");
	$parameters = ["favoriteProfileId" => $this->favoriteProfileId, "favoriteProductId" => $this->favoriteProductId, "favoriteDate" => $formattedDate];
	$statement->execute($parameters);
	// update the null favoriteProductId with what mySQL just gave us
	$this->favoriteProductIdId = intval($pdo->lastInsertId());
}

/**
 * Deletes this Favorite from mySQL
 *
 * @param \PDO $pdo PDO connection object
 * @throws \PDOException when mySQL related errors occur
 * @throws \TypeError if $pdo is not a PDO connection object
 **/
public function delete(\PDO $pdo): void {
	// enforce the favoriteProductId is not null (i.e., don't delete a tweet that hasn't been inserted)
	if($this->favoriteProductId === null) {
		throw(new \PDOException("unable to delete a tweet that does not exist"));
	}
	// create query template
	$query = "DELETE FROM favorite WHERE favoriteProductId = :favoriteProductId";
	$statement = $pdo->prepare($query);
{'fraction_non_alphanumeric': 0.13026819923371646, 'fraction_numerical': 0.005473453749315818, 'mean_word_length': 4.675465838509317, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '4104114', 'n_tokens_mistral': 1158, 'n_tokens_neox': 1118, 'n_words': 370}