public function addItem($location, $lastModified = null, $changeFrequency = null, $priority = null)
    {
        if ($this->urlsCount >= $this->maxUrls) {
            $this->finishFile();
        }

        if ($this->writerBackend === null) {
            $this->createNewFile();
        }

        if (is_array($location)) {
            $this->addMultiLanguageItem($location, $lastModified, $changeFrequency, $priority);
        } else {
            $this->addSingleLanguageItem($location, $lastModified, $changeFrequency, $priority);
        }

        $this->urlsCount++;

        if ($this->urlsCount % $this->bufferSize === 0) {
            $this->flush();
        }
    }
public function addItem($location, $lastModified = null, $changeFrequency = null, $priority = null)
    {
        if ($this->urlsCount >= $this->maxUrls) {
            $this->finishFile();
        }

        if ($this->writerBackend === null) {
            $this->createNewFile();
        }

        if (is_array($location)) {
            $this->addMultiLanguageItem($location, $lastModified, $changeFrequency, $priority);
        } else {
            $this->addSingleLanguageItem($location, $lastModified, $changeFrequency, $priority);
        }

        $this->urlsCount++;

        if ($this->urlsCount % $this->bufferSize === 0) {
            $this->flush();
        }
    }
public function addItem ( $ location , $ lastModified = null , $ changeFrequency = null , $ priority = null ) { if ( $ this -> urlsCount >= $ this -> maxUrls ) { $ this -> finishFile ( ) ; } if ( $ this -> writerBackend === null ) { $ this -> createNewFile ( ) ; } if ( is_array ( $ location ) ) { $ this -> addMultiLanguageItem ( $ location , $ lastModified , $ changeFrequency , $ priority ) ; } else { $ this -> addSingleLanguageItem ( $ location , $ lastModified , $ changeFrequency , $ priority ) ; } $ this -> urlsCount ++ ; if ( $ this -> urlsCount % $ this -> bufferSize === 0 ) { $ this -> flush ( ) ; } }
Adds a new item to sitemap

@param string|array $location location item URL
@param integer $lastModified last modification timestamp
@param string $changeFrequency change frequency. Use one of self:: constants here
@param string $priority item's priority (0.0-1.0). Default null is equal to 0.5

@throws \InvalidArgumentException
Adds a new item to sitemap