getIdColumns() public method

Get all columns that are marked an as an ID field
public getIdColumns ( ) : Column[]
return Column[]
Example #1
0
 /**
  * Get an ID for the given data
  *
  * @return string
  */
 public function getId()
 {
     $values = [];
     foreach ($this->metadata->getIdColumns() as $column) {
         $values[] = $this->getPropertyValue($column->getProperty());
     }
     if (!count($values)) {
         throw new InvalidEntityException('Entity "' . $this->metadata->getClassName() . '" has no ID column');
     }
     return implode(self::ID_DELIMITER, $values);
 }