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

Missing functions #38

Closed
featureless opened this issue Nov 29, 2012 · 3 comments
Closed

Missing functions #38

featureless opened this issue Nov 29, 2012 · 3 comments

Comments

@featureless
Copy link

Hi

when create() has been called, is there a way to check if the given object is a new object?

In idiorm there is a new function 'set_expr' but it's not implemented in paris.

Regards,

@treffynnon
Copy link
Collaborator

What do you mean check if it is a new object? It always is:

   protected function _create_model_instance($orm) {
        if ($orm === false) {
            return false;
        }
        $model = new $this->_class_name();
        $model->set_orm($orm);
        return $model;
    }

As for the other issue. Please keep issues separate and title them cleanly.

@featureless
Copy link
Author

Sorry but what I tried to tell is eg in this 2 calls how can we differentiate $user?
$user = Model::factory('User')->find_one($id);
$user = Model::factory('User')->create();

Or simply, in idiorm there is a is_new function but it's not implemented in paris.

@treffynnon
Copy link
Collaborator

OK. Thank you for clearing that up. I have added issues #39 and #40 to cover these two feature requests.

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

2 participants