Example #1
0
 /**
  * Deletes winner.
  *
  * @param Entity\TeamImpl $team
  * @param Entity\LeagueImpl $league
  * @throws RDException
  */
 public function deleteWinner($team, $league)
 {
     $q = 'DELETE FROM is_winner_of WHERE team_id = ? AND league_id = ?;';
     //create Prepared statement
     $stmt = $this->dbConnection->prepare($q);
     //bind parameter to query
     $teamId = $team->getId();
     $leagueId = $league->getId();
     $stmt->bindParam(1, $teamId, \PDO::PARAM_INT);
     $stmt->bindParam(2, $leagueId, \PDO::PARAM_INT);
     //execute query
     if ($stmt->execute()) {
         echo 'link deleted successfully';
     } else {
         throw new RDException('Deletion of link unsuccessful');
     }
 }