My problem is: I want to detect any changes of Email entity fields “subject”, “customHtml”,’ “dynamicContent”, “headers”. My use case is the following: the user creates a new template email with the builder interface. I need to know if the user has edited one of these content fields. Then I want to create some automatic translate email routings.
I see that there is isChanged
method in EmailBundle\Entity\Email
. It’s used by other attributes but not customHtml
. Is there a reason ?
If I add the method there
// EmailBundle/Entity/Email.php
public function setCustomHtml($customHtml)
{
// add isChanged
$this->isChanged('customHtml', $customHtml);
$this->customHtml = $customHtml;
return $this;
}
I can catch the Event EmailEvents::EMAIL_POST_SAVE
and
use the $event->getChanges()
method.
Is there a big impact ? Is there a reason the isChanged
method has not been added in customHtml ?