I’ve an error that I can’t understand. My usecase is that I want to inform user by mail if some properties are changed in updateAction. To decide if regarding properties are changed I use following code:
This works fine on my localhost, but on production server isEntityScheduled() always returns false.
Difference between localhost are FLOW_CONTEXT and php version. I tried to set context to production on my localhost to reproduce this behavior. But even in production mode it returns true. May the php version lead to this error? Locally I use php 7.2.21 and on the server there is 7.2.34 installed. On my MAMP version 7.2.34 is not available - so I can’t test.
This is driving me crazy, as I’ve no idea what to look up. So every hint is welcome.
thanks for your welcome and your reply.
I use it indeed inside an action. The way I embed the entitymanager is by injection.
/**
@Flow\Inject
@var ObjectManager
*/
protected $entityManager;
Above the class definiton I did:
use Doctrine\Common\Persistence\ObjectManager;
I tried it in the model itself with the preUpdate() method, which I use for other purposes. But I thought that it is a overhead as I only want the emails triggered in rare cases and the object is very often update by external API’s. The other drawback was that I had to build an uri passed to the email and use a translator for the email subject. I do not think that such things should be in a model.
I tried a few more things: