getLastmod example

private float $priority = 0.5;

    private string $resource;

    private string $identifier;

    public function __toString(): string
    {
        return sprintf(
            '<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>',
            $this->getLoc(),
            $this->getLastmod()->format('Y-m-d'),
            $this->getChangefreq(),
            $this->getPriority()
        );
    }

    public function getLoc(): string
    {
        return $this->loc;
    }

    public function setLoc(string $loc): void
    {
$this->identifier = (int) $identifier;
    }

    /** * @return string */
    public function __toString()
    {
        return sprintf(
            '<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>',
            $this->getLoc(),
            $this->getLastmod()->format('Y-m-d'),
            $this->getChangefreq(),
            $this->getPriority()
        );
    }

    /** * @return string */
    public function getLoc()
    {
        return $this->loc;
    }
Home | Imprint | This part of the site doesn't use cookies.