I am currently trying to update my code base to use namespacing and more if the OOP features of PHP >= 5.5.*
One of the problems I am running into is not data results using PHP's PDO lib to fetch a data model through a class object. For example:
$locations = DBO::getInstance()->query("
SELECT " . SWLocation::COLUMNS . "
FROM " . SWLocation::TABLE_NAME . " AS a
WHERE a.station_id = '" . $stationId . "'
AND (
a.site LIKE '%" . strval($terms) . "%'
OR a.frequency BETWEEN (FLOOR(" . floatval($terms) . ") + -0.5) AND (FLOOR(" . floatval($terms) . ") + 0.5)
)
")->fetchAll(\PDO::FETCH_CLASS, 'Ode\DBO\SWLocation\Model');
This query is not producing any data results in PHP, but when I print the query it gives me rows of results. I am guessing that the change over to the namespaced code is what is producing a problem when I reference the full namespace path to the data model class. Am I using this correctly? If not what else should I be doing?