public function getByReference($reference)
{
$classRaw = $this->db->fetchRow("SELECT * FROM " . self::TABLE_NAME . " WHERE reference=" . $this->db->quote($reference));
if (empty($classRaw)) {
throw new \Exception("Unit " . $reference . " not found.");
}
$this->assignVariablesToModel($classRaw);
}