Created
August 11, 2017 22:57
-
-
Save kzorluoglu/9e2952efa6a6b1827038c1caae4412a6 to your computer and use it in GitHub Desktop.
PHP - PDO Fetch All Objects with Model Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$query = $this->db->query('SELECT * FROM '.$this->table); | |
$result = $query->fetchAll(\PDO::FETCH_CLASS, 'Your\\Namespace\\andClassName'); | |
return $result; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment