[Solar-talk] Sql_Model insert not working!
Jeff Surgeson
solar at 3hex.com
Sun Apr 22 13:30:53 PDT 2007
Hi Rodrigo
> > I've noticed today that toArray() is not implemented in
> > Solar_Sql_Model. So $this->fetchNew()->toArray() will never work. How
> > we haven't noticed this?
> > I created a simple version:
> > public function toArray()
> > {
> > $this->_checkFocus('record');
> > $data = array();
> > foreach($this->_table_cols as $col_name => $spec) {
> > $data[$col_name] = $this->$col_name;
> > }
> > return $data;
> > }
> > It works for me and solves my problem. I hope I'm not missing anything.
>
> Will try it tomorrow and see if it works for me thanks a stack for sharing
> it :-)
Did not work for me, still cannot insert records, as far as I see
$item = $this->_news->fetchNew()->toArray();
wont work as $item needs to be an object not an array?
How did you go about getting a record insert to work?
--
...........::::::...........
Jeff Surgeson / South Africa
More information about the solar-talk
mailing list