mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Validating DateTime with NoObjectFound in Zend Doctrine #4949
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @adarshkhatri on GitHub (Dec 26, 2015).
Originally assigned to: @Ocramius on GitHub.
I am trying to validate my datetime in zend but no luck so far.
This is my function:
What I am trying to achieve?
I have got a holiday in my
table 1and while adding data totable 2, I would like to check if chosen date exist intable 1.If exist, throw custom message, else call add controller function.
However this is throwing me this message:
I am not sure if this is the right place to ask this qst. And this might not be a issue at all.
I had asked this qst in stackoverflow as well: http://stackoverflow.com/questions/34435198/validating-datetime-in-zend-doctrine
@Ocramius commented on GitHub (Dec 26, 2015):
The information you supplied is incomplete: what is the stack trace for
that error?
Also, I'm not sure if you can use the NoObjectExistsValidator, as it will
use strict comparison internally (if I remember correctly)
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
On 26 December 2015 at 11:13, Adarsh Khatri notifications@github.com
wrote:
@adarshkhatri commented on GitHub (Dec 26, 2015):
Thank you for quick reply.
That's all the error message I am receiving, it's fatal error.
Scenario
I believe when this looks
Holiday/Entity/Holidayentity table for datetime, it returns data as string, not an object, andformat()function is called indoctrine/dbal/lib/Doctrine/DBAL/Types/DateTimeType.php on line 53needs obviously object.I can confirm that I need to compare strictly with the holiday so that I will not allow users to choose that date.
Is there any other way to achieve this in Doctrine/ZF2?
@Ocramius commented on GitHub (Dec 26, 2015):
Hi,
On 26 December 2015 at 12:04, Adarsh Khatri notifications@github.com
wrote:
Believing won't bring you anywhere: please get the complete stack trace.
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
@Ocramius commented on GitHub (Dec 26, 2015):
Also, just realized that this is not an issue, therefore closing here: please ask for further help on the stackoverflow question that you linked above.