PHPePub\Core\EPub::setPublisher PHP Method

setPublisher() public method

An entity responsible for making the resource available. Examples of a Publisher include a person, an organization, or a service. Typically, the name of a Publisher should be used to indicate the entity. Used for the dc:publisher and dc:relation metadata parameters in the OPF file.
public setPublisher ( string $publisherName, string $publisherURL ) : boolean
$publisherName string
$publisherURL string
return boolean $success
    function setPublisher($publisherName, $publisherURL)
    {
        if ($this->isFinalized) {
            return false;
        }
        $this->publisherName = $publisherName;
        $this->publisherURL = $publisherURL;
        return true;
    }

Usage Example

 /**
  * @inheritdoc
  */
 public function initialization(Config $config)
 {
     $this->epub = new EPub();
     $this->epub->setTitle($config->get('title', 'untitled'));
     if ($isbn = $config->get('ISBN')) {
         $this->epub->setIdentifier($isbn, EPub::IDENTIFIER_ISBN);
     } else {
         $this->epub->setIdentifier($config->get('uri'), EPub::IDENTIFIER_URI);
     }
     $this->epub->setLanguage($config->get('language', 'zh-cn'));
     // Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc.
     $this->epub->setDescription($config->get('description'));
     $this->epub->setAuthor($config->get('author'), $config->get('author'));
     $this->epub->setPublisher($config->get('publisher.name'), $config->get('publisher.url'));
     // I hope this is a non existent address :)
     $this->epub->setDate(time());
     // Strictly not needed as the book date defaults to time().
     $this->epub->setRights($config->get('copyright'));
     // As this is generated, this _could_ contain the name or licence information of the user who purchased the book, if needed. If this is used that way, the identifier must also be made unique for the book.
     $this->epub->setSourceURL($config->get('publisher.url'));
     $this->epub->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, "PHP");
     $this->epub->buildTOC(NULL, "toc", "目录", TRUE, TRUE);
 }
All Usage Examples Of PHPePub\Core\EPub::setPublisher