public function save($name, array $data = [])
    {
        $table  = $this->_getTable();
        $entity = $table->findByName($name)->first();

        $newData = [
            'name'   => $name,
            'params' => $data
        ];

        if ($entity !== null && $entity->get('name') === $name) {
            $entity = $table->patchEntity($entity, $newData);
        } else {
            $entity = $table->newEntity($newData);
        }

        return $table->save($entity);
    }