php/Classes/Author.php
/**
	 * inserts this author 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
	 */
inserts this author 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
inserts this author 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 {
		$query = "INSERT INTO author(authorId, authorActivationToken, authorAvatarUrl, authorEmail, authorHash, authorUsername) VALUES(:authorId, :authorActivationToken, :authorAvatarUrl, :authorEmail, :authorHash, :authorUsername)";
		$statement = $pdo->prepare($query);
		$parameters = ["authorId" => $this->authorId->getBytes(), "authorActivationToken" => $this->authorActivationToken, "authorAvatarUrl" => $this->authorAvatarUrl, "authorEmail"=> $this->authorEmail, "authorHash"=>$this->authorHash, "authorUsername"=>$this->authorUsername];
		$statement->execute($parameters);
	}
public function insert ( \ PDO $ pdo ) : void { $ query = " INSERT INTO author(authorId, authorActivationToken, authorAvatarUrl, authorEmail, authorHash, authorUsername) VALUES(:authorId, :authorActivationToken, :authorAvatarUrl, :authorEmail, :authorHash, :authorUsername) " ; $ statement = $ pdo -> prepare ( $ query ) ; $ parameters = [ " authorId " => $ this -> authorId -> getBytes ( ) , " authorActivationToken " => $ this -> authorActivationToken , " authorAvatarUrl " => $ this -> authorAvatarUrl , " authorEmail " => $ this -> authorEmail , " authorHash " => $ this -> authorHash , " authorUsername " => $ this -> authorUsername ] ; $ statement -> execute ( $ parameters ) ; }
inserts this author 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
inserts this author 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
// create query template // bind the member variables to the place holders in the template