Returns the primary key for the passed security identity.
If the security identity does not yet exist in the database, it will be created.
SecurityIdentityInterface $sid:
integer
private function createOrRetrieveSecurityIdentityId(SecurityIdentityInterface $sid) {
if (false !== ($id = $this->connection
->executeQuery($this
->getSelectSecurityIdentityIdSql($sid))
->fetchColumn())) {
return $id;
}
$this->connection
->executeQuery($this
->getInsertSecurityIdentitySql($sid));
return $this->connection
->executeQuery($this
->getSelectSecurityIdentityIdSql($sid))
->fetchColumn();
}