Swiftriver\Core\DAL\Repositories\GenericQueryRepository::RunGenericQuery PHP Method

RunGenericQuery() public method

This function should allow calling classes to run basic sql select statements and switch the implmentation based on the data content type.
public RunGenericQuery ( string $sql ) : "errors"]\array["results"
$sql string
return "errors"]\array["results"
    public function RunGenericQuery($sql)
    {
        $dataContext = \Swiftriver\Core\Setup::DALConfiguration()->DataContextType;
        switch ($dataContext) {
            case "\\Swiftriver\\Core\\Modules\\DataContext\\MySql_V2\\DataContext":
                $db = \Swiftriver\Core\Modules\DataContext\MySql_V2\DataContext::PDOConnection();
                $statement = $db->prepare($sql);
                $result = $statement->execute();
                return $result == false ? array("results" => array(), "errors" => $statement->errorInfo()) : array("results" => $statement->fetchAll(), "errors" => null);
        }
    }
GenericQueryRepository