Facebook
Registers all of the Open Graph meta tags declared
@return void

Register an facebook opengraph property.
@param string $property
@param string $data
964727
public function renderFacebookMetaTags() {
		if (!isset($this->facebookTags['og:type']))
			$this->facebookTags['og:type'] = 'website'; // set website as the default type
		if (!isset($this->facebookTags['og:title']))
			$this->facebookTags['og:title'] = Yii::app()->name; // default to App name
		if (!isset($this->facebookTags['og:url']))
			$this->facebookTags['og:url'] = $this->getProtocol()."://".Yii::app()->request->serverName.Yii::app()->request->requestUri; // defaults to current URL
		foreach ($this->facebookTags as $type => $value) { // loop through any other OG tags declared
			$this->registerFacebook($type, $value);
		}
	}
245633
public static function Facebook($type, $data)
    {
        switch ($type) {
            case 'link':
                $message = isset($data['message']) ? $data['message'] : '';
                $result = FacebookApi::sendLink($data['link'], $data['message']);
                break;
            case 'photo':
                $message = isset($data['message']) ? $data['message'] : '';
                $result = FacebookApi::sendPhoto($data['photo'], $message);
                break;
            case 'video':
                $description = isset($data['description']) ? $data['description'] : '';
                $result = FacebookApi::sendVideo($data['video'], $data['title'], $description);
                break;
        }

        return ($result > 0) ? true : false;
    }
664415
public function bind($entity, array $data)
    {
        $meta = $this->getMeta();

        foreach ($data as $key => $value) {
            if (is_null($value)) {
                continue;
            }

            if (array_key_exists($key, $meta->fields)) {
                $property            = $meta->propertyName($key);
                $entity->{$property} = $value;
            }
        }

        $this->unitOfWork->getEntityRegistry()->getEntityBuilder()->resolve($entity);
    }
1288307
protected function setObjectProperties(array $properties, $data, array &$out = [])
    {
        foreach ($properties as $property) {
            $prop =  $property->getName();

            if (in_array($name = $this->normalize($prop), $this->ignoredAttributes)) {
                continue;
            }

            $out[$prop] = $this->getObjectPropertyValue($property, $prop, $data);
        }
    }
822394
public function addProperties($property, $editable)
    {
        $platformRoles = $this->roleManager->getAllPlatformRoles();

        foreach ($platformRoles as $role) {
            $prop = $this->profilePropertyRepo
                ->findBy(array('property' => $property, 'role' => $role));

            if (count($prop) === 0) $this->addProperty($property, $editable, $role);
        }
    }
732692
public function facebookOgData(array $ogData = array()) {
        $html = '';
        $metaTemplate = '<meta property="%s" content="%s">';
        $ini = Zend_Registry::get('config');

        if (!array_key_exists('admins', $ogData)) {
            if ($ini->auth->adapters->facebook->admins) {
                $ogData['admins'] = $ini->auth->adapters->facebook->admins;
            } else {
                throw new Exception(
                    'The auth.adapters.facebook.admins configuration parameter is missing. ' .
                    'Please use a numeric id, not a username.'
                );
            }
        }

        if (!array_key_exists('app_id', $ogData)) {
            if ($ini->auth->adapters->facebook->appId) {
                $ogData['app_id'] = $ini->auth->adapters->facebook->appId;
            }
        }

        // Set some defaults
        if (empty($ogData['url']) && isset($_SERVER['REQUEST_URI'])) {
            $ogData['url'] = $this->view->fullUrl($_SERVER['REQUEST_URI']);
        }
        if (empty($ogData['type'])) {
            if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] == '/') {
                $ogData['type'] = 'website';
            } else {
                $ogData['type'] = 'article';
            }
        }
        if (empty($ogData['title'])) {
            if ($this->view->title) {
                $title = $this->view->title;
            } else if (!empty($this->view->config()->app->name)) {
                $title = $this->view->config()->app->name;
            }

            if ($title) {
                $ogData['title'] = $title;
            }
        }

        if (empty($ogData['image']) && !empty($this->view->config()->app->image)) {
            if (basename($this->view->config()->app->image) === $this->view->config()->app->image) {
                $ogData['image'] = $this->view->image()->getUrl($this->view->config()->app->image);
            } else {
                $ogData['image'] = $this->view->fullUrl($this->view->config()->app->image);
            }
        }
        if (empty($ogData['description'])) {
            if ($this->view->description) {
                $ogData['description'] = __($this->view->description);
            } elseif (!empty($this->view->config()->app->description)) {
                $ogData['description'] = __($this->view->config()->app->description);
            }
        }
        if (empty($ogData['locale']) && !empty($this->view->config()->app->locale)) {
            $ogData['locale'] = $this->view->config()->app->locale;
        }

        if (!empty($this->view->config()->app->name)) {
            $ogData['site_name'] = $this->view->config()->app->name;
        }

        foreach ($ogData as $ogKey => $ogValue) {
            $prefix = in_array($ogKey, array('admins', 'app_id')) ? 'fb' : 'og';
            $metaHtml = sprintf(
                $metaTemplate,
                $this->view->escape($prefix . ':' . $ogKey),
                $this->view->escape($ogValue)
            );
            $html .= "$metaHtml\n";
        }
        return $html;
    }
1001713
public function add_meta($key, $meta_data) {
	if (is_object($meta_data)) {
		$meta_data = parent::convert_object_to_array($meta_data);
	}
	
	$this->meta_data[$key] = $meta_data;
}
8490
public function renderGoogleOwnerMetaTags() {
		foreach ($this->googleOwnerTags as $type => $value) { // loop through any other OG tags declared
			$this->registerGoogleOwner($type, $value);
		}
	}
1117867
public function addInheritedProperty(Property $property)
    {
        $inheritedProperty = clone $property;
        $declaringClass    = $property->getDeclaringClass();

        if ($inheritedProperty instanceof FieldMetadata) {
            if (! $declaringClass->isMappedSuperclass) {
                $inheritedProperty->setTableName($property->getTableName());
            }

            $this->fieldNames[$property->getColumnName()] = $property->getName();
        } elseif ($inheritedProperty instanceof AssociationMetadata) {
            if ($declaringClass->isMappedSuperclass) {
                $inheritedProperty->setSourceEntity($this->className);
            }

            // Need to add inherited fieldNames
            if ($inheritedProperty instanceof ToOneAssociationMetadata && $inheritedProperty->isOwningSide()) {
                foreach ($inheritedProperty->getJoinColumns() as $joinColumn) {
                    /** @var JoinColumnMetadata $joinColumn */
                    $this->fieldNames[$joinColumn->getColumnName()] = $property->getName();
                }
            }
        }

        if (isset($this->declaredProperties[$property->getName()])) {
            throw MappingException::duplicateProperty($this->className, $this->getProperty($property->getName()));
        }

        $this->declaredProperties[$property->getName()] = $inheritedProperty;

        if ($inheritedProperty instanceof VersionFieldMetadata) {
            $this->versionProperty = $inheritedProperty;
        }
    }
446888
public function MetaTags(&$tags)
    {
        // Add New Line (if does not exist):
        
        if (!preg_match('/[\n]$/', $tags)) {
            $tags .= "\n";
        }
        
        // Iterate Open Graph Metadata:
        
        foreach ($this->owner->config()->open_graph_metadata as $tag => $property) {
            $this->addMetaTag($tags, "og:{$tag}", $this->owner->$property);
        }
    }
1355181
public function registerManaged($document, $identifier, array $data)
    {
        $oid                              = spl_object_hash($document);
        $this->documentIdentifiers[$oid]  = $identifier !== null ? $identifier : $oid;
        $this->documentStates[$oid]       = self::STATE_MANAGED;
        $this->originalDocumentData[$oid] = $data;
        $this->addToIdentityMap($document);
    }
1372685
public function addProperty(string $property) : self
    {
        $property = strtolower($property);
        if (!in_array($property, $this->properties, true)) {
            $this->properties[] = $property;
        }

        return $this;
    }
29389
public function addMeta($property, $content, $position)
    {
        $content = $this->_normalizeContent($property, $content);

        switch($property) {
            case self::OG_TITLE:
            case self::OG_TYPE:
            case self::OG_DESCRIPTION:
            case self::OG_LOCALE:
            case self::OG_SITE_NAME:
            case self::OG_URL:
                if($this->hasMeta($property)) {
                    $this->removeMeta($property);
                    //$this->getMeta($property)->setContent($content);
                }
                break;
        }

        if($position == self::APPEND) {
            static::$storage->append(new Meta($property, $content));
        } else {
            $values = static::$storage->getArrayCopy();
            array_unshift($values, new Meta($property, $content));
            static::$storage->exchangeArray($values);
            unset($values);
        }

        return $this;
    }
696109
public function hasProperty($object, $property, $graph = 'default')
    {
        return $this->getStateMachine($object, $graph)->getCurrentState()->has($property);
    }
1059047
public function setOpenGraphType($type)
    {
        if (!empty($type)) {
            Yii::$app->view->registerMetaTag(['name' => 'og:type', 'content' => $type], 'og:type');
        }
        return $this;
    }
112826
public function register()
    {
        $this->app->singleton('seotools.metatags', function($app) {
            return new SEOMeta(new Config($app['config']->get('seotools.meta', [])));
        });

        $this->app->singleton('seotools.opengraph', function($app) {
            return new OpenGraph($app['config']->get('seotools.opengraph', []));
        });

        $this->app->singleton('seotools.twitter', function($app) {
            return new TwitterCards($app['config']->get('seotools.twitter.defaults', []));
        });

        $this->app->singleton('seotools.json-ld', function($app) {
            return new JsonLd($app['config']->get('seotools.json-ld.defaults', []));
        });

        $this->app->singleton('seotools', function() {
            return new SEOTools();
        });

        $this->app->bind(Contracts\MetaTags::class, 'seotools.metatags');
        $this->app->bind(Contracts\OpenGraph::class, 'seotools.opengraph');
        $this->app->bind(Contracts\TwitterCards::class, 'seotools.twitter');
        $this->app->bind(Contracts\JsonLd::class, 'seotools.json-ld');
        $this->app->bind(Contracts\SEOTools::class, 'seotools');
    }
581779
public function registerHTML($id, $html, $linear = 'yes', array $properties = []){
		$dom = $this->parser->parseFromString($html);
		if( $dom ){
			if( !isset($this->doms[$id]) ){
				$this->opf->addIdref($id.'.xhtml', $linear, $properties);
			}
			$this->doms[$id] = $dom;
			return $dom;
		}
		return false;
	}