Generation for the long type.

@param string $id 身份证号

@return array
8568
private function _generateLongType($id)
    {
        preg_match('/((.{6})(.{8})(.{3}))(.)/', $id, $matches);

        return [
            'body'         => $matches[1],
            'addressCode'  => $matches[2],
            'birthdayCode' => $matches[3],
            'order'        => $matches[4],
            'checkBit'     => $matches[5],
            'type'         => 18,
        ];
    }
757417
public function getSize($id = 0)
    {
        if ($id) {
            $pos = $this->_positions[$id - 1];
            return $pos['end'] - $pos['start'];
        }

        $result = array();
        foreach ($this->_positions as $num => $pos) {
            $result[$num + 1] = $pos['end'] - $pos['start'];
        }

        return $result;
    }
1129473
static public function getIdParents($id = null)
    {
        $id = ($id) ? $id : self::getIdActiveMenu();
        
        $idParent = self::getMapIdParent();
        
        if (!is_array( $id ))
        {
            if (isset( $idParent[ $id ] ))
            {
                $id = array($id);
            }
            else
            {
                return array();
            }
        }
        
        if (isset( $idParent[ end( $id ) ] ))
        {
            if (isset($idParent[ $idParent[ end( $id ) ] ]))
            {
                $id[] = $idParent[ end( $id ) ];
                return self::getIdParents($id);
            }
        }        
        
        return array_reverse( $id );       
    }
805320
public static function convertId($id)
    {
        if (strlen($id) === 17) {
            $converted = substr($id, 3) - 61197960265728;
        } else {
            $converted = '765' . ($id + 61197960265728);
        }
        return (string)$converted;
    }
165470
public static function getByIdType($id, $type)
    {
        $o = self::factory($type);
		$o->load($id);
        return $o;
    }
661366
public function getFullHostById($id)
    {
        foreach ($this->hosts as $host => $parameters) {
            if (!isset($parameters['id']) || $parameters['id'] !== $id) {
                continue;
            }

            return $parameters;
        }

        return null;
    }
1074874
private function generateMethodName($id)
    {
        if (isset($this->serviceIdToMethodNameMap[$id])) {
            return $this->serviceIdToMethodNameMap[$id];
        }

        $name = Container::camelize($id);
        $name = preg_replace('/[^a-zA-Z0-9_\x7f-\xff]/', '', $name);
        $methodName = 'get'.$name.'Service';
        $suffix = 1;

        while (isset($this->usedMethodNames[strtolower($methodName)])) {
            ++$suffix;
            $methodName = 'get'.$name.$suffix.'Service';
        }

        $this->serviceIdToMethodNameMap[$id] = $methodName;
        $this->usedMethodNames[strtolower($methodName)] = true;

        return $methodName;
    }
1326036
public function read($id)
    {
        $rows = $this->tableGateway->select(array(
            $this->options->getIdColumn()   => $id,
            $this->options->getNameColumn() => $this->sessionName,
        ));

        if ($row = $rows->current()) {
            if ($row->{$this->options->getModifiedColumn()} +
                $row->{$this->options->getLifetimeColumn()} > time()) {
                return base64_decode($row->{$this->options->getDataColumn()});
            }
            $this->destroy($id);
        }
        return '';
    }
562993
public function buildIds(string $id): array
    {
        $ids = [];
        $range = $this->buildRange($id);

        $from = $range->getFrom();
        $to = $range->getTo();
        $step = $range->getStep();
        for ($currentIndex = $from; $currentIndex <= $to; $currentIndex += $step) {
            $ids[
                str_replace(
                    $this->token,
                    $currentIndex,
                    $range->getName()
                )
            ] = $currentIndex;
        }

        return $ids;
    }
83981
public function getTypeOfId($id)
    {
        if (self::validateUserId($id, USER_ID_TYPE_COMMUNITY)) return USER_ID_TYPE_COMMUNITY;
        if (self::validateUserId($id, USER_ID_TYPE_STEAM)) return USER_ID_TYPE_STEAM;
        if (self::validateUserId($id, USER_ID_TYPE_VANITY)) return USER_ID_TYPE_VANITY;
        return FALSE;
    }
491741
public function MangaCharacters(int $id): array
    {
        return $this->myanimelist->getMangaCharacters(
            new Request\Manga\MangaCharactersRequest($id)
        );
    }
639446
public function getElement( $id )
	{
		$result = array();

		if ( isset( $this->elements[ $id ] ) )
		{
			foreach ( $this->elements[ $id ] as $key => &$element )
			{
				if ( isset( $element['parent'] ) ) continue;
				$element['parent'] = 'xbrl';
			}
			unset( $element );

			$result = $this->elements[ $id ];
		}

		if ( ! isset( $this->tupleRefs[ $id ] ) )
		{
			return $result;
		}
		// The rest of this needs sorting
		$tuple = $this->tupleRefs[ $id ];
		$tupleId = key( $tuple );

		if ( ! isset( $this->elements[ $tupleId ] ) )
		{
			return $result;
		}

		// $fact = array();

		foreach ( $tuple[ $tupleId ] as $index )
		{
			foreach ( $this->elements[ $tupleId ][ $index ]['tuple_elements'][ $id ] as $key => $entry )
			{
				if ( ! isset( $entry['tupleid'] ) )
				{
					$entry['tupleid'] = $tupleId;
				}
				$result[ $entry['guid'] ] = $entry;
			}
		}

		return $result;
	}
1363415
static public function getAllIdChilds($id)
    {
        $map = self::getMapParentId();
        
        $childId = array();
        
        if (isset( $map[$id] ))
        {
            foreach ($map[$id] as $val)
            {
                $childId = array_merge($childId,self::getAllIdChilds($val));
            }
            unset($val);
            
            return $childId;
        }
        else
        {
            return array( $id );
        }              
    }
583399
public function update($id)
    {
        $return = [];
        $class = $this->model;

        $this->input['id'] = $id;
        $this->validate(request(), $this->getValidationRules());

        $model = $class::find($id);
        if ($this->canEdit($model)) {
            $this->fillModel($model);

            $return = $model->push()
                ? ['success' => ucfirst($this->readableResourceType()) . ' updated successfully.']
                : ['error' => 'There was a problem saving the ' . $this->readableResourceType() . '.'];
        } else {
            $return = [
                'error' => 'You don\'t have permission to edit this '
                    . $this->readableResourceType() . '.'
            ];
        }

        return $return;
    }
678818
public function exportById($id): array
    {
        $site = Craft::$app->sites->getSiteById((int) $id);

        return $this->export($site);
    }
1056537
public function getTypeById( $id, $prefix = null )
	{
		if ( ! isset( $this->typeIds[ $id ] ) ) return false;
		return isset( $this->typeIds[ $id ]['istype'] ) && $this->typeIds[ $id ]['istype']
			? $this->getType( $this->typeIds[ $id ]['name'], $prefix )
			: $this->getElement( $this->typeIds[ $id ]['name'], $prefix );
	}
902391
public function mediatemplate($id)
    {
        $template = $this->templateManager->find($id);

        if (!$template) {
            return [];
        }

        return $template->getParameters();
    }