Artesaos\SEOTools\OpenGraph::setProperties PHP Method

setProperties() protected method

Set properties.
protected setProperties ( string $type = null, string $key = null, array $attributes = [], array $validKeys = [] ) : void
$type string type of og:type
$key string variable key
$attributes array inputted opengraph attributes
$validKeys array valid opengraph attributes
return void
    protected function setProperties($type = null, $key = null, $attributes = [], $validKeys = [])
    {
        if (isset($this->properties['type']) && $this->properties['type'] == $type) {
            foreach ($attributes as $attribute => $value) {
                if (in_array($attribute, $validKeys)) {
                    $this->{$key}[$attribute] = $value;
                }
            }
        }
    }