1

I am trying to fetch DateTime from database

$shop = $em->getRepository(BcUserSettings::class)->findOneById($shop_id);
$date = $shop->getSubscriptionExpiresOn();

then adding 30 days to it

$modify = $date->modify('+30 day');

and update it

$shop->setSubscriptionExpiresOn($modify);
$em->flush()

but my database has still the same DateTime. vardumping $modify

var_dump($modify);

shows

object(DateTime)#233 (3) { ["date"]=> string(19) "2018-03-20 00:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(12) "Asia/Kolkata" }

which is also a DateTime object then why doctrine is unable to update it?

0 Answers0