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

Use <current()> when construct a DateTime object #893

Closed
rchomat opened this issue Mar 15, 2018 · 1 comment
Closed

Use <current()> when construct a DateTime object #893

rchomat opened this issue Mar 15, 2018 · 1 comment

Comments

@rchomat
Copy link

rchomat commented Mar 15, 2018

Hi,

I try to set a DateTime object into one of my entity. Because I need to create several of this entity, I wanted to use the current function to format my date.
Here is an example of what I tried

AppBundle\Entity\Order:
    order_{1..2}:
        user: '@customer1'
        createdAt: '<(new \DateTime("next tuesday +<current()>-1 weeks"))>'

Is there a way to do something like this ?

Thank you for your help :)

@theofidry
Copy link
Member

Hi,

Although in theory possible, I think this is bout to be brittle until #712 is out so I would recommend you to use a custom faker provider instead :)

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