Generates the default metatags for the current object.
Prevents some problem where the defaultMetaTag method
content isn't set at the moment of setting the meta.
Should be called on preSave and preUpdate of the object.

@return self $this.
174401
public function generateDefaultMetaTags()
    {
        if ($this->isEmptyMeta($this->metaTitle)) {
            $this->setMetaTitle($this->defaultMetaTitle());
        }
        if ($this->isEmptyMeta($this->metaDescription)) {
            $this->setMetaDescription($this->defaultMetaDescription());
        }
        if ($this->isEmptyMeta($this->metaImage)) {
            $this->setMetaImage($this->defaultMetaImage());
        }
        return $this;
    }
44408
protected function createMetaInfoFolderAndFile()
    {
        $this->metaInfFolder = $this->createFolder($this->rootFolder, self::META_INF_FOLDER_NAME);

        $this->createManifestFile();

        return $this;
    }
1111625
private function _setDefaults()
    {
        if (!isset(self::$_template))
            self::_initializeDefaults();
        foreach (self::$_template as $k=>$v) {
            if ($k[0] != '_')
                $this->$k = $v;
        }
        return $this;
    }
1270113
public function meta()
    {
        $xml = (array) $this->xml;
        unset($xml['entry']);

        $xml['link'] = (object) $xml['link']->{"@attributes"};

        return (object) $xml;
    }
487601
public function metaData()
    {
        Meta::setTitle($this->fullName)
            ->set("description", $this->about)
            ->set("og:type", "profile", "property")
            ->set("og:title", $this->fullName, "property")
            ->set("og:description", $this->about, "property")
            ->set("og:url", $this->href, "property")
            ->setImageOG($this->profileImage)
            ->setProfileOG($this)
            ->setHrefLangData($this)
            ->setCanonical($this->href)
            ->setWildcards(
                [
                '{{firstName}}' => $this->firstName,
                '{{lastName}}' => $this->lastName,
                '{{title}}' => $this->firstName . " " . $this->lastName,
                '{{sitename}}' => settings('siteTitle')
                ]
            );
    }
480405
public function loadWebmasterTags()
	{
		foreach ($this->webmaster as $name => $value):
			if (!empty($value)):
				$meta = array_get(self::$webmasterTags, $name, $name);
				$this->addMeta($meta, $value);
			endif;
		endforeach;
	}
514047
function meta()
    {
        if (!$this->_rMetaInfo)
            $this->_rMetaInfo = new MetaReaderOfPhpResource($this->getRHandler());

        return $this->_rMetaInfo;
    }
1109240
public function metaData()
    {
        Meta::setTitle($this->title)
            ->set("description", $this->content())
            ->set("author", ($this->user ? $this->user->firstName." ".$this->user->lastName : null))
            ->set("og:type", "article", "property")
            ->set("og:title", $this->title, "property")
            ->set("og:description", $this->content(), "property")
            ->set("og:url", $this->href, "property")
            ->setImageOG(($this->hasFeaturedImage() ? $this->featuredImage : null))
            ->setArticleOG($this)
            ->setHrefLangData($this)
            ->setCanonical($this->href)
            ->setWildcards(
                [
                '{{categoryTitle}}'=>($this->hasCategory() ? $this->category->title :  null),
                '{{title}}' => $this->title,
                '{{sitename}}' => settings('siteTitle')
                ]
            );

        return;
    }
315191
public function generateAlteredMeta()
    {
        //get unmanaged converted to managed
        $managed = array_intersect(
            $this->oldUnmanagedKeys,
            $this->newModelKeys
        );

        //get managed converted to unmanaged
        $unmanaged = array_intersect(
            $this->oldModelKeys,
            $this->newUnmanagedKeys
        );

        $modelsToCheck = array_merge(
            $this->keptProxyKeys,
            $this->keptUnmanagedKeys,
            $managed,
            $unmanaged
        );

        $modelsToCheck = array_unique($modelsToCheck);

        /* @var $oldState ModelState */
        /* @var $newState ModelState */
        foreach ($modelsToCheck as $modelName) {
            $oldModelName = $this->getOldModelName($modelName);
            $oldState = $this->fromState->getModelState($oldModelName);
            $newState = $this->toState->getModelState($modelName);

            $oldMeta = [];

            if ($oldState->getMeta()) {
                foreach ($oldState->getMeta() as $name => $opt) {
                    if (AlterModelMeta::isAlterableOption($name)) {
                        $oldMeta[$name] = $opt;
                    }
                }
            }

            $newMeta = [];
            if ($newState->getMeta()) {
                foreach ($newState->getMeta() as $name => $opt) {
                    if (AlterModelMeta::isAlterableOption($name)) {
                        $newMeta[$name] = $opt;
                    }
                }
            }

            if ($oldMeta !== $newMeta) {
                $this->addOperation(
                    $newMeta->getAppName(),
                    AlterModelMeta::createObject(
                        [
                            'name' => $modelName,
                            'meta' => $newMeta,
                        ]
                    )
                );
            }
        }
    }
342146
public function MetaTags($includeTitle = true)
    {
        $tags = [];
        $owner = $this->getOwner();

        if ($includeTitle && strtolower($includeTitle) != 'false') {
            $tags[] = HTML::createTag(
                'title',
                [],
                $owner->obj('Title')->forTemplate()
            );
        }

        $generator = trim(Config::inst()->get(self::class, 'meta_generator'));
        if (!empty($generator)) {
            $tags[] = HTML::createTag('meta', array(
                'name' => 'generator',
                'content' => $generator,
            ));
        }

        $charset = ContentNegotiator::config()->uninherited('encoding');
        $tags[] = HTML::createTag('meta', array(
            'http-equiv' => 'Content-Type',
            'content' => 'text/html; charset=' . $charset,
        ));
        if ($owner->MetaDescription) {
            $tags[] = HTML::createTag('meta', array(
                'name' => 'description',
                'content' => $owner->MetaDescription,
            ));
        }

        if (Permission::check('CMS_ACCESS_CMSMain') && $owner->exists()) {
            $tags[] = HTML::createTag(
                'meta',
                [
                    'name' => 'x-page-id',
                    'content' => $owner->obj('ID')->forTemplate()
                ]
            );
            $tags[] = HTML::createTag(
                'meta',
                [
                    'name' => 'x-cms-edit-link',
                    'content' => $owner->obj('CMSEditLink')->forTemplate()
                ]
            );
        }

        $tags = implode("\n", $tags);
        if ($owner->ExtraMeta) {
            $tags .= $owner->obj('ExtraMeta')->forTemplate();
        }

        $owner->extend('updateMetaTags', $tags);

        return $tags;
    }
619088
public function generate()
	{
		$this->loadWebmasterTags();

		$title       = $this->getTitle();
		$description = $this->getDescription();
		$keywords    = $this->getKeywords();
		$metatags    = $this->metatags;

		$html = array();

		$html[] = "<title>$title</title>";
		$html[] = sprintf('<meta name="description" itemprop="description" content="%s" />%s', $description, PHP_EOL);

		if (!empty($keywords)) {
			$html[] = sprintf('<meta name="keywords" content="%s" />%s', $keywords, PHP_EOL);
		}

		foreach ($metatags as $key => $value):
			$name    = $value[0];
			$content = $value[1];
			$html[] = sprintf('<meta %s="%s" content="%s" />%s', $name, $key, $content, PHP_EOL);
		endforeach;

		return implode(PHP_EOL, $html);
	}
72361
public function getDefaultAttributes()
    {
        $default_attributes = [
            new TextAttribute('identifier', $this),
            new IntegerAttribute('revision', $this, [ 'default_value' => 0 ]),
            new UuidAttribute('uuid', $this, [ 'default_value' => 'auto_gen' ]),
            new TextAttribute('language', $this, [ 'default_value' => 'de_DE' ]),
            new IntegerAttribute('version', $this, [ 'default_value' => 1 ]),
            new TextAttribute('workflow_state', $this),
            new KeyValueListAttribute('workflow_parameters', $this)
        ];

        if ($this->isHierarchical()) {
            $default_attributes[] = new TextAttribute('parent_node_id', $this);
        }

        $default_attributes_map = new AttributeMap($default_attributes);
        return parent::getDefaultAttributes()->append($default_attributes_map);
    }
996818
protected function getTagMetaModel()
    {
        if (empty($this->objSelectMetaModel)) {
            $this->objSelectMetaModel = $this->objAttribute->getTagMetaModel();
        }

        return $this->objSelectMetaModel;
    }
870252
public function getMetas()
    {
        $ret = array();

        if (!isset($this->metas['title']) && $this->getParameter('nyroDev_utility.share.title')) {
            $this->setTitle($this->getParameter('nyroDev_utility.share.title'));
        }
        if (!isset($this->metas['description']) && $this->getParameter('nyroDev_utility.share.description')) {
            $this->setDescription($this->getParameter('nyroDev_utility.share.description'));
        }
        if (!isset($this->metas['keywords']) && $this->getParameter('nyroDev_utility.share.keywords')) {
            $this->set('keywords', $this->getParameter('nyroDev_utility.share.keywords'));
        }
        if (!isset($this->metasProp['og:image']) && $this->getParameter('nyroDev_utility.share.image')) {
            $this->setImage($this->getParameter('nyroDev_utility.share.image'));
        }

        if (isset($this->metas['title']) && $this->metas['title']) {
            $ret[] = '<title>'.$this->metas['title'].'</title>';
            unset($this->metas['title']);
        }

        foreach ($this->metas as $k => $v) {
            $ret[] = '<meta name="'.$k.'" content="'.str_replace('"', '&quot;', $v).'" />';
        }
        foreach ($this->metasProp as $k => $v) {
            $ret[] = '<meta property="'.$k.'" content="'.str_replace('"', '&quot;', $v).'" />';
        }

        return implode("\n", $ret);
    }
66867
protected function tagDescription()
	{

		// Get the default value in config file if not manually defined
		$description = ($this->description) ? $this->description : $this->getConfig('description');

		// Don't return any tag if value is empty
		if ($description)
		{
			return '<meta name="description" content="'.$description.'">' . "\n\t";
		}
	}
145855
protected function set_defaults()
	{
		parent::set_defaults();
		$this->headers = array();

		if ( ! empty($this->preserve_resource))
		{
			$this->resource = $this->preserve_resource;
			$this->preserve_resource = null;
		}

		return $this;
	}
976612
public static <T> Meta<T> meta() {
    return new Meta<>(MetaConfig.defaultConfig(), null, TYPED_PROPERTY_ARRAYS.empty(), TYPED_STRING_ARRAYS.empty());
  }