public function finish(array $items = []): bool
    {
        $changed = false;

        foreach ($items as $key => $value) {
            $serialized = \serialize($value);

            if (! $this->check($key, $serialized)) {
                $changed = true;

                try {
                    $this->saving($key, $serialized, $this->isNewKey($key));
                } catch (PDOException $e) {
                    // Should be able to ignore failure since it is possible that
                    // the request is done on a read only connection.
                }
            }
        }

        if ($changed && $this->cache instanceof Repository) {
            $this->cache->forget($this->cacheKey);
        }

        return true;
    }
public function finish(array $items = []): bool
    {
        $changed = false;

        foreach ($items as $key => $value) {
            $serialized = \serialize($value);

            if (! $this->check($key, $serialized)) {
                $changed = true;

                try {
                    $this->saving($key, $serialized, $this->isNewKey($key));
                } catch (PDOException $e) {
                    // Should be able to ignore failure since it is possible that
                    // the request is done on a read only connection.
                }
            }
        }

        if ($changed && $this->cache instanceof Repository) {
            $this->cache->forget($this->cacheKey);
        }

        return true;
    }
public function finish ( array $ items = [ ] ) : bool { $ changed = false ; foreach ( $ items as $ key => $ value ) { $ serialized = \ serialize ( $ value ) ; if ( ! $ this -> check ( $ key , $ serialized ) ) { $ changed = true ; try { $ this -> saving ( $ key , $ serialized , $ this -> isNewKey ( $ key ) ) ; } catch ( PDOException $ e ) { // Should be able to ignore failure since it is possible that // the request is done on a read only connection. } } } if ( $ changed && $ this -> cache instanceof Repository ) { $ this -> cache -> forget ( $ this -> cacheKey ) ; } return true ; }
Save data to database.

@param  array   $items

@return bool
Save data to database .