public function update($dataOrModel, array $where, $tableName = null, HydratorInterface $hydrator = null)
    {
        $tableName = $tableName ?: $this->getTableName();
        $data = $this->extract($dataOrModel, $hydrator);
        if ($tableName === $this->getTableName()) {
            $data = $this->cleanData($data);
        }

        $sql = $this->getSql();
        $update = $sql->update($tableName);

        $update->set($data)
            ->where($where);

        $statement = $sql->prepareStatementForSqlObject($update);

        return $statement->execute();
    }