What does this mean in OOP for PHP?
Posted on 2013-01-18
I'm slowly making my way through the basics of OOP and I've come across something that I've yet to see in the tutorials that I'm referring to.
In every example thus far, when you see something like this:
$this->featured_image="", it's referring to a variable of some sort that's generated in a query or something like that.
Here's what I'm looking at:
I'm getting an error that says, "Catchable fatal error: Object of class SingleImage could not be converted to string in /mnt/vhosts/heavydutylighting.com/httpdocs/cms/mod_product/product.inc.php on line 174"
Line 174 is this: WHERE uuid='".$this-> featured_image_index_1." from the following query:
DELETE FROM single_images
WHERE uuid='".$this-> featured_image_index_1."'
OR uuid='".$this-> featured_image_index_2."'
So when I got to the class SingleImage file and look for where featured_image_index_1 is being defined, thinking I'm getting the error because there's no variable retrieved for the query to work, there is no reference to featured_index_image_1 at all. I've got the code attached.
My question is: Is the error that I'm getting being generated because there is no value for $this->featured_image_index_1? Is that why I'm getting the error that says it can't be converted to a string?