record exist validation with doctrine

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

record exist validation with doctrine

rashmi
Hi,

I am beginner for zend , if any one knows how to get record exist validation without use of  Zend_Validate_Db_NoRecordExists  , I can't use this validation because use doctrine . I am not sure that with doctrine connection I am free to use Zend_Validate_Db_NoRecordExists  or not  , but if I use this with doctrine than get db adapter error.

If any one know , plz reply

Thx , in advance

Rashmi
Reply | Threaded
Open this post in threaded view
|

Réponse automatique d'absence du bureau : record exist validation with doctrine

m.marion
Banned User
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: record exist validation with doctrine

Marco Pivetta
In reply to this post by rashmi
This is my implementation, it has to be revised and contains some clutter,
but it works fine for me :)

https://gist.github.com/940549

Some notes:

 a) it supposes you extend your entities from a single @MappedSuperclass
(Gamempire\Entity in my case)
 b) it supposes that you'll pass a subclass of the $matchedEntity you pass
to it during construction
 c) it uses some deprecated stuff as you can see, if you want to refactor it
and share, please let me know, I'll copy-paste it in my library :)

Hope that helps!

Marco Pivetta
@Ocramius <http://twitter.com/Ocramius>
http://marco-pivetta.com



On 25 April 2011 15:05, rashmi <[hidden email]> wrote:

> Hi,
>
> I am beginner for zend , if any one knows how to get record exist
> validation
> without use of  Zend_Validate_Db_NoRecordExists  , I can't use this
> validation because use doctrine . I am not sure that with doctrine
> connection I am free to use Zend_Validate_Db_NoRecordExists  or not  , but
> if I use this with doctrine than get db adapter error.
>
> If any one know , plz reply
>
> Thx , in advance
>
> Rashmi
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/record-exist-validation-with-doctrine-tp3473105p3473105.html
> Sent from the Zend Auth mailing list archive at Nabble.com.
>
> --
> List: [hidden email]
> Info: http://framework.zend.com/archives
> Unsubscribe: [hidden email]
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Réponse automatique d'absence du bureau : record exist validation with doctrine

Vijay Bose
This post was updated on .
In reply to this post by m.marion
Hey,

I am not sure why can't you try 'exist()' method in doctrine for checking existing records.

You can refer the following link:

http://www.doctrine-project.org/projects/orm/1.2/docs/manual/component-overview/en#record:checking-existence



Regads,
Vijay
Vijay Bose.