/**
  *
  * @param \models\services\LookupResult $lookupResult
  * @param type $preciseLong
  * @param type $preciseLat
  * @return \models\entities\GeocodeCached
  */
 protected function cacheLookup(LookupResult $lookupResult, $preciseLong, $preciseLat, $extraData = array())
 {
     $data = array('longitude' => $preciseLong, 'latitude' => $preciseLat) + $lookupResult->getCachingData($extraData);
     if ($data['longitude'] && $data['longitude']) {
         $saveId = $this->geocodeCachedManager->createEntity($data)->save(true);
         return $this->geocodeCachedManager->getEntity($saveId);
     } else {
         return null;
     }
 }
 /**
  *
  * Generates QRCode for the ticket URL of a particular showtime.
  * @param $showtimeId
  * @return null|string the path to the QRCode PNG file on success.
  * @throws \DbTableException
  */
 public function getPNGQrCode($showtimeId)
 {
     $cached = $this->checkCache($showtimeId, true);
     if ($cached) {
         return $cached;
     }
     $showtime = $this->showtimeManager->getEntity($showtimeId);
     if ($showtime && $showtime->url) {
         try {
             $shorten = $this->getBitly()->shorten($showtime->url, 'j.mp');
         } catch (\Exception $e) {
             \SystemLogger::warn(get_class($e), $e->getTraceAsString());
         }
         $l = $shorten ? $shorten['url'] : \SystemConfig::getInstance()->site['redirect_base'] . $showtimeId;
         $filename = $this->cacheName($showtimeId, true);
         QRcode::png($l, $filename, QR_ECLEVEL_L, 4, 1);
         return $filename;
     }
     return null;
 }