private function Controller::createOrRetrieveClassId

Returns the primary key for the passed class type.

If the type does not yet exist in the database, it will be created.

Parameters

string $classType:

Return value

integer

3 calls to Controller::createOrRetrieveClassId()
Controller::createObjectIdentity in drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php
Creates the ACL for the passed object identity
Controller::updateAceProperty in drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php
This processes changes on an ACE related property (classAces, or objectAces).
Controller::updateFieldAceProperty in drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php
This processes changes on an ACE related property (classFieldAces, or objectFieldAces).

File

drupal/core/vendor/doctrine/common/tests/Doctrine/Tests/Common/Annotations/Fixtures/Controller.php, line 73

Class

Controller
@Route("/someprefix") @author Johannes M. Schmitt <schmittjoh@gmail.com>

Namespace

Doctrine\Tests\Common\Annotations\Fixtures

Code

private function createOrRetrieveClassId($classType) {
  if (false !== ($id = $this->connection
    ->executeQuery($this
    ->getSelectClassIdSql($classType))
    ->fetchColumn())) {
    return $id;
  }
  $this->connection
    ->executeQuery($this
    ->getInsertClassSql($classType));
  return $this->connection
    ->executeQuery($this
    ->getSelectClassIdSql($classType))
    ->fetchColumn();
}