WhichBrowser\Data\DeviceModels::identifyBlackBerry PHP Method

identifyBlackBerry() public static method

public static identifyBlackBerry ( $model )
    public static function identifyBlackBerry($model)
    {
        $original = $model;
        if (preg_match("/BlackBerry ?([0-9]+)/ui", $model, $match)) {
            $model = $match[1];
        }
        $device = new Device(['type' => Constants\DeviceType::MOBILE, 'identified' => Constants\Id::NONE, 'manufacturer' => null, 'model' => $model, 'identifier' => $original, 'generic' => false]);
        if (preg_match("/^[1-9][0-9][0-9][0-9][ei]?\$/u", $model)) {
            $device->manufacturer = 'RIM';
            $device->model = 'BlackBerry ' . $model;
            $device->identified = Constants\Id::PATTERN;
            if (isset(self::$BLACKBERRY_MODELS[$model])) {
                $device->model = 'BlackBerry ' . self::$BLACKBERRY_MODELS[$model] . ' ' . $model;
                $device->identified |= Constants\Id::MATCH_UA;
            }
        }
        return $device;
    }