2016-10-06 02:08:43 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace JKingWeb\NewsSync\Db;
|
|
|
|
|
|
|
|
Trait CommonPDO {
|
2017-02-16 20:29:42 +00:00
|
|
|
public function query(string $query): Result {
|
|
|
|
return new ResultPDO($this->db->query($query));
|
|
|
|
}
|
2016-10-06 02:08:43 +00:00
|
|
|
|
2017-02-16 20:29:42 +00:00
|
|
|
public function prepareArray(string $query, array $paramTypes): Statement {
|
|
|
|
return new StatementPDO($query, $paramTypes);
|
|
|
|
}
|
2016-10-06 02:08:43 +00:00
|
|
|
|
2017-02-16 20:29:42 +00:00
|
|
|
public function prepare(string $query, string ...$paramType): Statement {
|
|
|
|
return $this->prepareArray($query, $paramType);
|
|
|
|
}
|
2016-10-06 02:08:43 +00:00
|
|
|
}
|