2015-04-02 23:23:34 +02:00
|
|
|
<?php
|
|
|
|
namespace Framadate\Repositories;
|
|
|
|
|
|
|
|
use Framadate\FramaDB;
|
|
|
|
|
|
|
|
abstract class AbstractRepository {
|
|
|
|
/**
|
|
|
|
* @var FramaDB
|
|
|
|
*/
|
|
|
|
private $connect;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PollRepository constructor.
|
|
|
|
* @param FramaDB $connect
|
|
|
|
*/
|
|
|
|
function __construct(FramaDB $connect) {
|
|
|
|
$this->connect = $connect;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function beginTransaction() {
|
|
|
|
$this->connect->beginTransaction();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function commit() {
|
|
|
|
$this->connect->commit();
|
|
|
|
}
|
|
|
|
|
2015-04-03 00:11:36 +02:00
|
|
|
function rollback() {
|
|
|
|
$this->connect->rollback();
|
|
|
|
}
|
|
|
|
|
2015-04-02 23:23:34 +02:00
|
|
|
public function prepare($sql) {
|
|
|
|
return $this->connect->prepare($sql);
|
|
|
|
}
|
|
|
|
|
2015-04-03 00:11:36 +02:00
|
|
|
function query($sql) {
|
|
|
|
return $this->connect->query($sql);
|
|
|
|
}
|
|
|
|
|
|
|
|
function lastInsertId() {
|
|
|
|
return $this->connect->lastInsertId();
|
|
|
|
}
|
2015-04-02 23:23:34 +02:00
|
|
|
}
|