Пример #1
0
 /**
  * Removes all caches for a specific image. This is usually called
  * when a new version of an image is uploaded.
  * 
  * Automatically calls "flush" on the entity manager.
  * 
  * @param Image $image The image to invalidate
  */
 public static function invalidate(Image $image)
 {
     $qb = PartKeepr::getEM()->createQueryBuilder();
     $qb->select(array("c"))->from('PartKeepr\\Image\\CachedImage', 'c')->where("c.originalId = :id")->andWhere("c.originalType = :type")->setParameter("id", $image->getId())->setParameter("type", $image->getType());
     $query = $qb->getQuery();
     $bImagesRemoved = false;
     foreach ($query->getResult() as $file) {
         unlink($file->getCacheFile());
         PartKeepr::getEM()->remove($file);
         $bImagesRemoved = true;
     }
     if ($bImagesRemoved) {
         PartKeepr::getEM()->flush();
     }
 }
Пример #2
0
 /**
  * Creates a new IC logo instance
  */
 public function __construct()
 {
     parent::__construct(Image::IMAGE_ICLOGO);
 }
Пример #3
0
 /**
  * Creates a new IC logo instance
  */
 public function __construct()
 {
     parent::__construct(Image::IMAGE_FOOTPRINT);
 }
Пример #4
0
 public function __construct()
 {
     parent::__construct(Image::IMAGE_TEMP);
 }
 /**
  * Creates a new storage location image instance
  */
 public function __construct()
 {
     parent::__construct(Image::IMAGE_STORAGELOCATION);
 }