Get a specific type of phone number
@param $type
@return mixed
323965
public function getPhoneNumber($type)
    {
        if (!in_array($type, [PhoneNumber::WORK, PhoneNumber::HOME, PhoneNumber::FAX, PhoneNumber::MOBILE]))
        {
            throw new InvalidArgumentException($type . " is not a valid phone number type.");
        }

        return $this->phoneNumbers[$type];
    }
940029
protected function getResultsByType($type)
    {
        $mapper = $this->relatedMapper->getManager()->mapper($type);

        $key = $mapper->getEntityMap()->getKeyName();

        $query = $mapper->getQuery();

        return $query->whereIn($key, array_keys($this->dictionary[$type]))->get();
    }
376233
protected function getHtmlType($type)
    {
        $map = Config::getEloquentToHtmlMap();

        if (array_key_exists($type, $map)) {
            return $map[$type];
        }

        return 'text';
    }
1013915
public function getAddressesForType($type)
    {
        if (!isset($this->addresses[$type])) {
            throw new \Parable\Mail\Exception('Only to, cc, bcc addresses are allowed.');
        }

        $addresses = [];
        foreach ($this->addresses[$type] as $address) {
            if (!empty($address['name'])) {
                $addresses[] = $address['name'] . ' <' . $address['email'] . '>';
            } else {
                $addresses[] = $address['email'];
            }
        }
        return implode(', ', $addresses);
    }
628584
public function fetch($type = 'num')
    {
        $row = parent::fetch($type);
        if ($type == 'assoc' && is_array($row) && !empty($this->_driver->autoShortenedIdentifiers)) {
            //Need to preserve order of row results
            $translatedRow = [];
            foreach ($row as $key => $val) {
                if (array_key_exists($key, $this->_driver->autoShortenedIdentifiers)) {
                    $translatedRow[$this->_driver->autoShortenedIdentifiers[$key]] = $val;
                } else {
                    $translatedRow[$key] = $val;
                }
            }
            $row = $translatedRow;
        }
        return $row;
    }
36267
public function fetch($type = parent::FETCH_TYPE_NUM)
    {
        $callback = $this->_callback;
        $row = $this->_statement->fetch($type);

        return $row === false ? $row : $callback($row);
    }
365958
private static function isNumberType(Type $type)
    {
        return $type instanceof IntegerType || $type instanceof SmallIntType || $type instanceof BigIntType || $type instanceof DecimalType || $type instanceof FloatType;
    }
1187983
public function type($type)
    {
        if (is_string($type)) {
            $map = array(
                'double' => 1,
                'string' => 2,
                'object' => 3,
                'array' => 4,
                'binary' => 5,
                'undefined' => 6,
                'objectid' => 7,
                'boolean' => 8,
                'date' => 9,
                'null' => 10,
                'regex' => 11,
                'jscode' => 13,
                'symbol' => 14,
                'jscodewithscope' => 15,
                'integer32' => 16,
                'timestamp' => 17,
                'integer64' => 18,
                'maxkey' => 127,
                'minkey' => 255,
            );

            $type = isset($map[$type]) ? $map[$type] : $type;
        }

        return $this->operator('$type', $type);
    }
1074645
protected function getResultsByType($type)
    {
        $instance = $this->createModelByType($type);

        $ownerKey = $this->ownerKey ?? $instance->getKeyName();

        $query = $this->replayMacros($instance->newQuery())
                            ->mergeConstraintsFrom($this->getQuery())
                            ->with($this->getQuery()->getEagerLoads());

        return $query->whereIn(
            $instance->getTable().'.'.$ownerKey, $this->gatherKeysByType($type)
        )->get();
    }
326707
public function type($type = null)
    {
        if (!func_num_args()) {
            return $this->_type;
        }
        $this->_type = $type;
        return $this;
    }
1240375
public function getErrorsByType(string $type): array
    {
        return array_filter(
            $this->getMessages(),
            function (LogMessage $message) use ($type) {
                return $message->getLevel() === $type;
            }
        );
    }
986291
public function getApiTicket($type)
    {
        return $this->auth(function () use ($type) {
            return $this->http->getJson(
                $this->baseUrl . 'cgi-bin/ticket/getticket',
                ['access_token' => $this->accessToken, 'type' => $type]
            );
        });
    }
456149
protected function getTypeCategory($type)
    {
        $extensions = $this->extensions;
        $navClasses = 'app';
        if (isset($type)) {
            if ($type->name == 'Yii' || $type->name == 'YiiRequirementChecker') {
                $navClasses = 'yii';
            } elseif (strncmp($type->name, 'yii\\', 4) == 0) {
                $navClasses = 'yii';
                $subName = substr($type->name, 4);
                if (($pos = strpos($subName, '\\')) !== false) {
                    $subNamespace = substr($subName, 0, $pos);
                    if (in_array($subNamespace, $extensions)) {
                        $navClasses = $subNamespace;
                    }
                }
            }
        }

        return $navClasses;
    }
206873
public function fetchAll($type = parent::FETCH_TYPE_NUM)
    {
        return array_map($this->_callback, $this->_statement->fetchAll($type));
    }
237582
public static function get($type)
    {
        if (\is_string($type))
        {
            if (\defined(static::class . '::' . $type))
            {
                return \constant(static::class . '::' . $type);
            }

            if (\defined($type))
            {
                return \constant($type);
            }

            return \T_STRING;
        }

        foreach (static::constants() as $name => $value)
        {
            if ($value === $type)
            {
                return $name;
            }
        }

        $token = \token_name($type);

        if ($token === 'UNKNOWN')
        {
            return 'T_STRING';
        }

        return $token;
    }
653747
static public function getStorableType( $type )
    {
        switch ( $type )
        {
            case 'google':      return self::TYPE_GOOGLE;
            case 'facebook':    return self::TYPE_FACEBOOK;
            case 'yahoo':       return self::TYPE_YAHOO;
            case 'twitter':     return self::TYPE_TWITTER;
        }
    }
711835
protected function getTypeForString($type)
    {
        switch ($type) {
            case 'string':
                return DataTypes::STRING_TYPE;
            case 'number':
                return DataTypes::NUMBER_TYPE;
            case 'date':
            case 'datetime':
                return DataTypes::DATETIME_TYPE;
            case 'boolean':
                return DataTypes::BOOLEAN_TYPE;
            case 'tags':
                return DataTypes::TAGS_TYPE;
            case 'auto-complete':
                return DataTypes::AUTO_COMPLETE_TYPE;
            default:
                return DataTypes::UNDEFINED_TYPE;
        }
    }