src/Model/Repository/BaseRepository.php
public function insert($data = [])
	{
		try {
			$newRow = $this->table()->insert($data);

		} catch (\PDOException $e) {
			if ($e->getCode() == '23000') {
				throw new DuplicateEntryException;
			} else {
				throw $e;
			}
		}

		return $newRow;
	}
public function insert($data = [])
	{
		try {
			$newRow = $this->table()->insert($data);

		} catch (\PDOException $e) {
			if ($e->getCode() == '23000') {
				throw new DuplicateEntryException;
			} else {
				throw $e;
			}
		}

		return $newRow;
	}
@param $data

@throws \Aprila\DuplicateEntryException
@return Nette\Database\Table\IRow