/** * @param \Eccube\Entity\Member $Member * @return bool */ public function delete(\Eccube\Entity\Member $Member) { $em = $this->getEntityManager(); $em->getConnection()->beginTransaction(); try { $rank = $Member->getRank(); $em->createQueryBuilder()->update('Eccube\\Entity\\Member', 'm')->set('m.rank', 'm.rank - 1')->where('m.rank > :rank')->setParameter('rank', $rank)->getQuery()->execute(); $Member->setDelFlg(1)->setRank(0); $em->persist($Member); $em->flush(); $em->getConnection()->commit(); } catch (\Exception $e) { $em->getConnection()->rollback(); return false; } return true; }
/** * {@inheritDoc} */ public function setDelFlg($delFlg) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDelFlg', array($delFlg)); return parent::setDelFlg($delFlg); }