Back to Microdata class

Method getExpectedTypes

public static array
getExpectedTypes
(mixed $type, mixed $property)
Return the expected Types of the given Property
Parameters
  • string $type The Type to process
  • string $property The Property to process
Returns
  • array
Since
  • 3.2
Class: Microdata
Project: Joomla

Method getExpectedTypes - Source code

/**
 * Return the expected Types of the given Property
 *
 * @param   string  $type      The Type to process
 * @param   string  $property  The Property to process
 *
 * @return  array
 *
 * @since   3.2
 */
public static function getExpectedTypes($type, $property)
{
    static::loadTypes();
    $tmp = static::$types[$type]['properties'];
    // Check if the $Property is in the $Type
    if (isset($tmp[$property])) {
        return $tmp[$property]['expectedTypes'];
    }
    // Check if the $Property is inherit
    $extendedType = static::$types[$type]['extends'];
    // Recursive
    if (!empty($extendedType)) {
        return static::getExpectedTypes($extendedType, $property);
    }
    return array();
}