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

Lifecycle Callbacks of entities arent supported #5

Open
andimg93 opened this issue Feb 14, 2021 · 1 comment
Open

Lifecycle Callbacks of entities arent supported #5

andimg93 opened this issue Feb 14, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@andimg93
Copy link

andimg93 commented Feb 14, 2021

Hey,

is there any possibility to support lifecycle callbacks while bulk inserting? E.g. prePersist oder preUpdate where the created/updated dates are set.

/**
 * @PrePersist
 */
public function prePersist(): void
{
	$now = new DateTime();
	$this->setCreated($now);
	$this->setUpdated($now);
}

/**
 * @PreUpdate
 */
public function preUpdate(): void
{
	$this->setUpdated(new DateTime());
}

the entity itself:

/**
 * @ORM\HasLifecycleCallbacks()
 */
class Foo
{
	// code
}

just dummy code and dummy logic, could be more complex - I just wanted to show u what i mean.

So what do u mean?

@dotfry
Copy link
Member

dotfry commented Feb 22, 2021

Hello! I didn't have plans for Lifecycle Callbacks. But i'll think if i have time, ill add this functionality.

@dotfry dotfry added the enhancement New feature or request label Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants