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