Worker ID

@return string
961590
public function getId()
    {
        if (null === $this->id) {
            $this->setId($this->getHostname() . ':' . $this->getProcess()->getPid() . ':' . implode(',', $this->queues));
        }

        return $this->id;
    }
1113127
public function getWorker($id)
    {
        if (!isset($this->workers[$id])) {
            $this->workers[$id] = new Worker($id);
        }

        return $this->workers[$id];
    }
1304763
public static function generateId()
    {
        static $inc = 0;

        $ts = pack('N', time());
        $m = substr(md5(gethostname()), 0, 3);
        $pid = pack('n', 1);
        $trail = substr(pack('N', $inc++), 1, 3);

        $bin = sprintf('%s%s%s%s', $ts, $m, $pid, $trail);
        $id = '';
        for ($i = 0; $i < 12; $i++) {
            $id .= sprintf('%02X', ord($bin[$i]));
        }

        return strtolower($id);
    }
480708
public function getCurrentEntityId()
	{
		$query = new Query;
		$query->select('tbl_party.id AS id')
			->from('tbl_user')
      		->innerJoin('tbl_contact', 'tbl_contact.email = tbl_user.email')
      		->innerJoin('tbl_party','tbl_party.id = tbl_contact.party_id')
			->where('tbl_user.id = '.\Yii::$app->user->identity->id)
			->one();
		
		$command = $query->createCommand();
		$row = $command->queryOne();

		if(!is_null($row['id']))
		{
			return $row['id'];
		}
		return NULL;
	}
1003266
public function getId() {
		$options = $this->getOptions();
		$id = elgg_extract('list_id', $options);
		if (!$id) {
			$id = md5($this->getBaseURL());
		}
		return $id;
	}
543416
public function getWorkId()
	{
		$max = Member::max('work_id');
		if ($max=='') $max = 0;
		$max++;

		$pos = stripos($max,'4');
		if ($pos=='') {
			# code...
		}else{
			$length = strlen($max);

			for ($i=($pos+1); $i < $length; $i++) { 
				$max = substr_replace($max,'0',$i,($length-$pos));
			}

			$max = str_ireplace("4","5",$max);
		}
		
		$max = intval($max);

		return $max;
	}
1365021
public function getId()
    {
        if ( empty( $this->id ) )
        {
            if ( $this->getColumnsUseTranslation() )
            {
                $id = trim( $this->getColumnTranslatePrefix() . '.' .
                            $this->getColumnTranslatePostfix(), '.' );

                if ( ! empty( $id ) )
                {
                    return str_replace( '.', '_', $id );
                }
            }

            $this->id = String::generateRandom();
        }

        return $this->id;
    }
92971
public function get_unique_id() {
        global $CFG;

        if (!is_null($this->uniqueid)) {
            return $this->uniqueid;
        }

        // Generate a unique id for this site, this model and this time splitting method, considering the last time
        // that the model target and indicators were updated.
        $ids = array($CFG->wwwroot, $CFG->prefix, $this->model->id, $this->model->version);
        $this->uniqueid = sha1(implode('$$', $ids));

        return $this->uniqueid;
    }
223604
public function getCurrentOrganizationId()
    {
        $orgId = $this->_getVar('user_organization_id');

        //If not set, read it from the cookie
        if ($this->isCurrentUser() && ((null === $orgId) || (\Gems_User_UserLoader::SYSTEM_NO_ORG === $orgId))) {
            $request = $this->getRequest();
            if ($request) {
                $orgId = \Gems_Cookies::getOrganization($this->getRequest());
            }
            if (! $orgId) {
                $orgId = 0;
            }
            $this->_setVar('user_organization_id', $orgId);
        }
        return $orgId;
    }
816122
public function id() {
		$res = $this->_match;
		$count = count($res);

		if (empty($this->_stub['id'])) {
			if (empty($res[$count - 1])) {
				return '';
			}
			$this->_stub['id'] = $res[$count - 1];
		}
		$id = $this->_stub['id'];

		for ($i = 1; $i <= $count; $i++) {
			$id = str_ireplace('$' . $i, $res[$i - 1], $id);
		}
		return $id;
	}
892477
private function getLockID()
    {
        if ($this->lockID) {
            return $this->lockID;
        }

        $id = uniqid('thumbnail_thread_', true);

        $this->lockID = $id;
        return $id;
    }
725372
public function getId()
    {
        $class = get_class($this);
        $id = lcfirst(explode('\\', $class)[1]);
        $id = $this->str->dash($id);

        return $id;
    }
1155756
public function isUserProcess($worker_id = null)
    {
        //一定要===
        if ($worker_id === null) {
            $worker_id = $this->workerId;
        }
        return $worker_id >= $this->worker_num + $this->task_num ? true : false;
    }
219719
protected static function _getUserId()
    {
        if (is_null(self::$_userID)) {
            self::$_userID = null;
            if (isset(Yii::$app->user) and !empty(Yii::$app->user->id)) {
                self::$_userID = Yii::$app->user->id;
            }
        }

        return self::$_userID;
    }
587853
public static function redisKey($worker = null, $suffix = null)
    {
        if (is_null($worker)) {
            return 'workers';
        }

        $id = $worker instanceof Worker ? $worker->id : $worker;

        return 'worker:'.$id.($suffix ? ':'.$suffix : '');
    }
536080
public function getId()
    {
        if (is_null($this->_id)) {
            $this->_id = md5(serialize($this->instructions));
        }

        return $this->_id;
    }
581184
public function getId()
    {
        return sprintf(
          '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
          mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff),
          mt_rand(0, 0x0fff) | 0x4000,
          mt_rand(0, 0x3fff) | 0x8000,
          mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
        );
    }