FileStorage::delete

public FileStorage::delete($name)

Deletes a configuration object from the storage.

Parameters

string $name: The name of a configuration object to delete.

Return value

bool TRUE on success, FALSE otherwise.

Overrides StorageInterface::delete

File

core/lib/Drupal/Core/Config/FileStorage.php, line 170

Class

FileStorage
Defines the file storage.

Namespace

Drupal\Core\Config

Code

public function delete($name) {
  if (!$this->exists($name)) {
    $dir = $this->getCollectionDirectory();
    if (!file_exists($dir)) {
      throw new StorageException($dir . '/ not found.');
    }
    return FALSE;
  }
  $this->fileCache->delete($this->getFilePath($name));
  return drupal_unlink($this->getFilePath($name));
}
doc_Drupal
2016-10-29 09:13:39
Comments
Leave a Comment

Please login to continue.