src/Eccube/Repository/AbstractRepository.php line49

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Eccube\Repository;
  13. use Eccube\Entity\AbstractEntity;
  14. use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
  15. abstract class AbstractRepository extends ServiceEntityRepository
  16. {
  17.     /**
  18.      * @var array
  19.      */
  20.     protected $eccubeConfig;
  21.     /**
  22.      * エンティティを削除します。
  23.      * 物理削除ではなく、del_flgを利用した論理削除を行います。
  24.      *
  25.      * @param AbstractEntity $entity
  26.      */
  27.     public function delete($entity)
  28.     {
  29.         $this->getEntityManager()->remove($entity);
  30.     }
  31.     /**
  32.      * エンティティの登録/保存します。
  33.      *
  34.      * @param $entity|AbstractEntity エンティティ
  35.      */
  36.     public function save($entity)
  37.     {
  38.         $this->getEntityManager()->persist($entity);
  39.     }
  40.     protected function getCacheLifetime()
  41.     {
  42.         return $this->eccubeConfig['eccube_result_cache_lifetime'];
  43.     }
  44. }