OEModule\PASAPI\models\PasApiAssignment::lock PHP Method

lock() protected method

Lock the assignment so no other instances can clash with efforts to create or update the record.
protected lock ( $resource_type, $resource_id )
$resource_type
$resource_id
    protected function lock($resource_type, $resource_id)
    {
        $cmd = $this->dbConnection->createCommand('SELECT GET_LOCK(?, 1)');
        $key = $this->getLockKey($resource_type, $resource_id);
        while (!$cmd->queryScalar(array($key))) {
        }
    }