I know it's a lot of code but I can't work out why this is happening all of a sudden, literally in one refresh without any change to code. Even if I backtrace to earlier versions that also worked this is happening.

When I attempt to do:

print($this->_config->columns($key, "position"));

It returns:

Catchable fatal error: Object of class Column could not be converted
to string in /home/reithg/public_html/test/engine/class.database.php
*on line 50*

Which shows that I am performing name() on a member of class Column which has a public method called name()

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

5

Debug - is what each one of us does for up to 90% of day. So should you.
–
zerkmsDec 15 '11 at 11:03

Hard to say, man. You should pay attention to the line of the error and find which object of $this->_config->columns($key, "position")->name() isn't working.
–
user898741Dec 15 '11 at 11:07

@Márcio I have noticed this but $this->_config->columns($key, "position") is returning a member of the class Column which has a method name(). @zerkms This is a sudden error and is due to no change I have obviously been attempting to debug it but when that doesn't work...?
–
George ReithDec 15 '11 at 11:10

When you say:
"I know it's a lot of code but I can't work out why this is happening all of a sudden, literally in one refresh without any change to code. Even if I backtrace to earlier versions that also worked this is happening." I would like to ask if you are programming on you PHP code through a browser? If so, sometimes the cache will mess with you, and I find it much easier to develop my PHP models through the PHP command-line interface.
If this is not for you, maybe consider turning your browsers cache completely off when developing.

I think the problem you are experiencing comes from syntax errors in the public function columns of your Config class. I think you have to read up on the syntax of switch-cases http://php.net/manual/en/control-structures.switch.php here you will notice that you have used semicolons after case guards, where you should have used simply colons. Also there is no need to break; after you return, as your code will never reach this point anyway ...