Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ChrissDeGrece opened this issue Jun 27, 2014 · 0 comments
Open

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

ChrissDeGrece opened this issue Jun 27, 2014 · 0 comments

Comments

@ChrissDeGrece
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant