/** * returns Name of the newsletter who has id = $id * * @param int $id * @param bool $forceCreate : if newsletter not exists create it * * @return string */ function getNewsletterName($id, $forceCreate = false) { if (!isset($this->a_newsletters)) { $this->loadNewsletter(); } if (!isset($this->a_newsletters[$id]) && $forceCreate) { // If not exists, and force create : create Newsletter $confSite = new SiteConfigDb(); if (defined("NEWSLETTER_CREATE_NAME")) { $confSite->createNewsletter($id, NEWSLETTER_CREATE_NAME . $id, $this->id); } else { $confSite->createNewsletter($id, 'Newsletter : ' . $id, $this->id); } // Reload Newsletter $this->loadNewsletter(); } return isset($this->a_newsletters[$id]) ? $this->a_newsletters[$id] : false; }