Hi everyone,
I am trying to JSON encode all attributes for a model, both from DB and not from DB. I am however experiencing difficulty even after doing what the documentation says should work.
So I using the code much like:
CJSON::encode($product->getAttributes())
And in the documentation is states that the default param to get all attributes is true. Thing is I have two predefined (in the model) variables:
-
public $title_type
-
public $deleted
And these do not seem to be returned with the DB attributes of the model. So what I actually get back is:
{"title_id":"26","isbn_10":"","isbn_13":"","isbn_status":"0","issn":"","version":"0","status":"","availability":"0","shelf":"","publisher_id":"","vatable":"0","id":null,"toc":null,"publication_date":null,"consignment":null,"trade":null,"returnable":null,"licence":null,"status_last_confirmed":null,"on_hand":null,"available":null,"on_order":null,"preferred":null,"reorder":null,"unwanted":null,"description":null,"update_time":null,"create_time":null}
Am I missing something to be able to return these two non-db varialbes from the model as well?
I mean, just in case I even added these to the attributeLabels() function in case that had something to do with their return but still nothing.
Thanks,