public function create(ImportURLModel $importURL, SiteModel $site, UserAccountModel $creator)
 {
     global $DB;
     try {
         $DB->beginTransaction();
         $stat = $DB->prepare("SELECT max(slug) AS c FROM import_url_information WHERE site_id=:site_id");
         $stat->execute(array('site_id' => $site->getId()));
         $data = $stat->fetch();
         $importURL->setSlug($data['c'] + 1);
         $stat = $DB->prepare("INSERT INTO import_url_information (site_id, slug, title,url,url_canonical,created_at,group_id,is_enabled,country_id,area_id, approved_at, is_manual_events_creation) " . "VALUES (:site_id, :slug, :title,:url,:url_canonical, :created_at, :group_id,:is_enabled,:country_id,:area_id,:approved_at,:is_manual_events_creation) RETURNING id");
         $stat->execute(array('site_id' => $site->getId(), 'slug' => $importURL->getSlug(), 'title' => substr($importURL->getTitle(), 0, VARCHAR_COLUMN_LENGTH_USED), 'url' => substr($importURL->getUrl(), 0, VARCHAR_COLUMN_LENGTH_USED), 'url_canonical' => substr($importURL->getUrlCanonical(), 0, VARCHAR_COLUMN_LENGTH_USED), 'group_id' => $importURL->getGroupId(), 'country_id' => $importURL->getCountryId(), 'area_id' => $importURL->getAreaId(), 'created_at' => \TimeSource::getFormattedForDataBase(), 'approved_at' => \TimeSource::getFormattedForDataBase(), 'is_enabled' => $importURL->getIsEnabled() ? 1 : 0, 'is_manual_events_creation' => $importURL->getIsManualEventsCreation() ? 1 : 0));
         $data = $stat->fetch();
         $importURL->setId($data['id']);
         $stat = $DB->prepare("INSERT INTO import_url_history (import_url_id, title, user_account_id  , created_at,group_id,is_enabled,country_id,area_id, approved_at, is_new, is_manual_events_creation) VALUES " . "(:curated_list_id, :title, :user_account_id  , :created_at, :group_id,:is_enabled,:country_id,:area_id, :approved_at, '1', :is_manual_events_creation )");
         $stat->execute(array('curated_list_id' => $importURL->getId(), 'title' => substr($importURL->getTitle(), 0, VARCHAR_COLUMN_LENGTH_USED), 'group_id' => $importURL->getGroupId(), 'country_id' => $importURL->getCountryId(), 'area_id' => $importURL->getAreaId(), 'user_account_id' => $creator->getId(), 'created_at' => \TimeSource::getFormattedForDataBase(), 'approved_at' => \TimeSource::getFormattedForDataBase(), 'is_enabled' => $importURL->getIsEnabled() ? 1 : 0, 'is_manual_events_creation' => $importURL->getIsManualEventsCreation() ? 1 : 0));
         $DB->commit();
     } catch (Exception $e) {
         $DB->rollBack();
     }
 }
 public function getNotificationURL()
 {
     global $CONFIG;
     $this->loadImportURLIfNeeded();
     return $CONFIG->getWebSiteDomainSecure($this->site->getSlug()) . '/importurl/' . $this->importURL->getSlug();
 }