code: protected function findKey(Table $Table, Entity $entity) {
  		if (!empty($entity->{$Table->primaryKey()})) {
  			$key = $entity->{$Table->primaryKey()};
  		} else {
  			$key = 'unknown';
  		}
  
  		return $key;
  	}
docs: Helper method to find the primary key for a record.
  
  @param Cake\ORM\Table $Table An instantiated Table object.
  @param Cake\ORM\ntity $entity The record being saved into the DB.
  @return string The numeric or UUID value of the record's primary key, or 'unknown' on failure.