/** * Renew egood link * * @return void */ protected function doActionEgoodsRenew() { $id = \XLite\Core\Request::GetInstance()->attachment_id; $attachment = \XLite\Core\Database::getRepo('XLite\\Module\\CDev\\Egoods\\Model\\OrderItem\\PrivateAttachment')->find($id); if (!$attachment) { \XLite\Core\TopMessage::addError('Download link did not found'); } elseif (!$attachment->isActive()) { \XLite\Core\TopMessage::addError('Download link is not active'); } else { $attachment->renew(); \XLite\Core\Database::getEM()->flush(); \XLite\Core\Mailer::sendEgoodsLinks($attachment->getItem()->getOrder()); \XLite\Core\TopMessage::addInfo('Download link is renew'); } }