Calotype\SEO\Generators\MetaGenerator::fromObject PHP Method

fromObject() public method

Use the meta data of a MetaAware object.
public fromObject ( Calotype\SEO\Contracts\MetaAware $object )
$object Calotype\SEO\Contracts\MetaAware
    public function fromObject(MetaAware $object)
    {
        $data = $object->getMetaData();
        if (array_key_exists('title', $data)) {
            $this->setTitle($data['title']);
        }
        if (array_key_exists('description', $data)) {
            $this->setDescription($data['description']);
        }
        if (array_key_exists('keywords', $data)) {
            $this->setKeywords($data['keywords']);
        }
        if (array_key_exists('canonical', $data)) {
            $this->setCanonical($data['canonical']);
        }
    }