PSR fixes

This commit is contained in:
Martin Konecny 2012-09-05 17:44:09 -04:00
parent 43f5258219
commit 139950fac2
1 changed files with 4 additions and 3 deletions

View File

@ -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;
} }
} }