PSR fixes
This commit is contained in:
parent
43f5258219
commit
139950fac2
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
class Application_Common_Database{
|
class Application_Common_Database{
|
||||||
public static function prepareAndExcute($sql, $paramValueMap, $type='all'){
|
public static function prepareAndExecute($sql, $paramValueMap, $type='all')
|
||||||
|
{
|
||||||
$con = Propel::getConnection();
|
$con = Propel::getConnection();
|
||||||
$stmt = $con->prepare($sql);
|
$stmt = $con->prepare($sql);
|
||||||
foreach ($paramValueMap as $param => $v) {
|
foreach ($paramValueMap as $param => $v) {
|
||||||
|
@ -10,7 +11,7 @@ class Application_Common_Database{
|
||||||
if ($stmt->execute()) {
|
if ($stmt->execute()) {
|
||||||
if ($type == 'single') {
|
if ($type == 'single') {
|
||||||
$rows = $stmt->fetch(PDO::FETCH_ASSOC);
|
$rows = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
} else if ($type == 'column'){
|
} elseif ($type == 'column'){
|
||||||
$rows = $stmt->fetchColumn();
|
$rows = $stmt->fetchColumn();
|
||||||
} else {
|
} else {
|
||||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
@ -21,4 +22,4 @@ class Application_Common_Database{
|
||||||
}
|
}
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue