private function getIdentifierField() { if (null !== $this->identifierField) { return $this->identifierField; } $metadata = $this->em->getClassMetadata($this->table->getEntity()); if ($metadata->isIdentifierComposite) { throw new \Exception('composite identifiers are currently not supported.'); } $identifier = $metadata->getIdentifier(); if (1 !== sizeof($identifier)) { throw new \Exception('exactly one identifier expected.'); } $this->identifierField = $identifier[0]; return $this->identifierField; }