flourishlib / flourish-classes

The class files for Flourish
http://flourishlib.com
182 stars 78 forks source link

Any way to add non database "fields" to fActiveRecord? #209

Open ChrissDeGrece opened 10 years ago

ChrissDeGrece commented 10 years ago

Hi,

Suppose I have a table:

PostID int(10)
UserID int(10)

then I do:

fORMJSON::extend();
$post = new Post(1);

echo $post->toJSON();

I would like to add a field to the fActiveRecord that doesn't exist in the table, for example:

$post->addnodbfieldNewField();
$post->setNewField('Some value');
echo $post->toJSON();

Is there any way I can do that and get the new field in the json response?

I have solved my problem by extending my Post class but just want to know if there is a flourish way to do it.