public function id($disallow_null = false)
{
$id = $this->get($this->_get_id_column_name());
if ($disallow_null) {
if (is_array($id)) {
foreach ($id as $id_part) {
if ($id_part === null) {
throw new Exception('Primary key ID contains null value(s)');
}
}
} else {
if ($id === null) {
throw new Exception('Primary key ID missing from row or is null');
}
}
}
return $id;
}