Esempio n. 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();
     }
 }
 /**
  * Creates a new IC logo instance
  */
 public function __construct()
 {
     parent::__construct(Image::IMAGE_ICLOGO);
 }
Esempio n. 3
0
 /**
  * Creates a new IC logo instance
  */
 public function __construct()
 {
     parent::__construct(Image::IMAGE_FOOTPRINT);
 }
Esempio n. 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);
 }