Back to Microdata class

Method property

public \Joomla\CMS\Microdata\Microdata
property
(mixed $property)
Setup a $Property
Parameters
  • string $property The Property
Returns
  • \Joomla\CMS\Microdata\Microdata Instance of $this
Since
  • 3.2
Class: Microdata
Project: Joomla

Method property - Source code

/**
 * Setup a $Property
 *
 * @param   string  $property  The Property
 *
 * @return  Microdata  Instance of $this
 *
 * @since   3.2
 */
public function property($property)
{
    if (!$this->enabled) {
        return $this;
    }
    // Sanitize the $Property
    $property = static::sanitizeProperty($property);
    // Control if the $Property exists in the given $Type and setup it, otherwise leave it 'NULL'
    if (static::isPropertyInType($this->type, $property)) {
        $this->property = $property;
    }
    return $this;
}