Recently, I took it upon myself to try and learn OO programming. It has been about 3 months since I started, but I think I might be missing the point because I seem to prefer static methods (which seem 'easier' to me).
Example
Here is what a typical DB query looks like in my code.
$bindings = array(':name'=>$articleName);
Db::query('SELECT id, name, title, image, content FROM ' . CONFIG_MYSQL_TABLE_PREFIX . 'articles WHERE name = :name LIMIT 1', $bindings);
And here is how I resize/crop/cache images
$image = Img::thumbnail($imagePath, 200);
$imgHtml = '<img alt="' . $this->getTitle() . '" src="' . '' . $image['src'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" />';
Both of the static methods utilise a singleton pattern.. the first one creates one PDO object and the second one creates one ImageResize class I found on Google code.
Should these be 2 objects if I really wanted to call it object oriented programming? i.e.
$db = new Db();
$image = new Image($src, $width, $height);
For everytime I use them? I've read singletons are also a bad idea unless they're being used for logging to a file. But isn't a singleton good for one DB connection being opened when needed and closed only after it's been used and finished with?
My question is, am I still stuck in the procedural mindset, and if so, is what I'm doing considered bad practise? How can I immerse myself in the correct OO thought patterns?
Update
Thanks for the answers. I do find the original methods I'm doing are easier as I have to type less code and let the static methods worry about little implementation things.
I will look into another language to get a solid grasp of OO, which language though will be another question itself.