Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ModelCriteria should have an exist method. #427

Closed
Meijuh opened this Issue · 13 comments

3 participants

@Meijuh

I think a good feature in the ModelCriteria class is a public function exist($con = null) which returns a boolean.
Underwater it should do an EXIST SELECT .... which also returns true or false. Then, someone does not have to check if find() returns an empty collection or count() returns zero.

Maybe this is also good for performance?

@fzaninotto
Collaborator

Great idea!

@willdurand
Owner

@Meijuh wanna ship it?

@Meijuh

@willdurand I am quite new to git. Do you mean I implement this in ModelCriteria, write tests and then do a pull request?

@willdurand
Owner

Yes! It would be wonderful

@Meijuh

Okey, I think I have some time this week to implement this. I think you have to assign me to this issue?

@willdurand
Owner
@Meijuh

I haven't implemented this yet, but I would not mind implementing it this week. Is it okey if I do a pull request before end of the week?

@willdurand
Owner
@fzaninotto
Collaborator

By the way I think the method should be named isEmpty(), exists(), or hasResults(), to match the naming scheme used for other ModelCriteria methods.

@willdurand
Owner

Is EXIST available on all database vendors?

@Meijuh

I think this will cost me too much time to implement as I have to dig deep into Propel. Can anyone else implement this?

@willdurand
Owner

Can you tell me if EXIST is cross vendors?

@willdurand willdurand referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@willdurand willdurand referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@willdurand
Owner

@Meijuh See: #438, please try.

@willdurand willdurand closed this issue from a commit
@willdurand willdurand Add new termination method: exists()
Closes #427.
Issue URL: #427.
754adbf
@willdurand willdurand closed this in 754adbf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.