Exemplo n.º 1
0
 /**
  * Removes a stored option.
  *
  * @param  string $name The name of the option to be removed.
  * @throws \InvalidArgumentException
  */
 public function remove($name)
 {
     $name = trim($name);
     if (in_array($name, $this->protected)) {
         throw new \InvalidArgumentException(sprintf('"%s" is a protected option and may not be modified.', $name));
     }
     if (!$this->connection->isConnected()) {
         throw new \RuntimeException('Database is not connected.');
     }
     $this->initialize(true);
     if ($this->connection->delete($this->table, ['name' => $name])) {
         unset($this->options[$name]);
         $this->cache->delete($this->prefix . (isset($this->autoload[$name]) ? 'Autoload' : $name));
     }
 }