示例#1
0
 /**
  * Gets the name of the single id field. Note that this only works on
  * entity classes that have a single-field pk.
  *
  * @return string
  * @throws MappingException If the class has a composite primary key.
  */
 public function getSingleIdentifierFieldName()
 {
     if ($this->isIdentifierComposite) {
         throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->name);
     }
     return $this->identifier[0];
 }