public static function fileExists(PromoImage $promoImage, $cityId) { $f = GlobalFile::newFromText($promoImage->getPathname(), $cityId); $title = GlobalTitle::newFromText($promoImage->getPathname(), NS_FILE, $cityId); return $title->exists() && $f->exists(); }
public static function srcFileExists(PromoImage $targetPromoImage) { $promoImage = new PromoImage($targetPromoImage->getType()); $title = GlobalTitle::newFromText($promoImage->getPathname(), NS_FILE, $targetPromoImage->cityId); // $f = GlobalFile::newFromText($promoImage->getPathname(), $targetPromoImage->getCityId()); return $title->exists(); }