public function getByName($name = null)
{
if ($name != null) {
$this->model->setName($name);
}
$name = $this->model->getName();
$storeId = $this->model->getStoreId();
$stmt = "SELECT * FROM " . self::TABLE_NAME_KEYS . " WHERE name = " . $this->db->quote($name) . " and storeId = " . $storeId;
$data = $this->db->fetchRow($stmt);
if ($data["id"]) {
$this->assignVariablesToModel($data);
} else {
throw new \Exception("KeyConfig with name: " . $this->model->getName() . " does not exist");
}
}