Facebook\InstantArticles\Transformer\Rules\TimeRule::createFrom PHP Method

createFrom() public static method

public static createFrom ( $configuration )
    public static function createFrom($configuration)
    {
        $time_rule = self::create();
        $time_rule->withSelector($configuration['selector']);
        $time_rule->withProperties([self::PROPERTY_TIME, self::PROPERTY_DATETIME_TYPE], $configuration);
        // Just for retrocompatibility - issue #172
        if (isset($configuration[self::PROPERTY_TIME_TYPE_DEPRECATED])) {
            $time_rule->type = $configuration[self::PROPERTY_TIME_TYPE_DEPRECATED];
        }
        return $time_rule;
    }