public function refresh() { $this->cashStore->deleteAll(); $all = $this->dataSource->getAll(); if ($all instanceof \Traversable or is_array($all)) { foreach ($all as $item) { $this->cashStore->create($item, true); } } else { throw new DataStoreException("Not return data by DataSource"); } }
/** * {@inheritdoc} * * {@inheritdoc} */ public function deleteAll() { $this->preDeleteAll(); $result = $this->dataStore->deleteAll(); return $this->postDeleteAll($result); }