Esempio n. 1
0
 /**
  * Returns the Riak instance for a class.
  *
  * @param string $className The class name.
  * @return \CosmoW\Riak\Database
  */
 public function getDocumentDatabase($className)
 {
     $className = ltrim($className, '\\');
     if (isset($this->documentDatabases[$className])) {
         return $this->documentDatabases[$className];
     }
     $metadata = $this->metadataFactory->getMetadataFor($className);
     $db = $metadata->getDatabase();
     $db = $db ? $db : $this->config->getDefaultDB();
     $db = $db ? $db : 'doctrine';
     $this->documentDatabases[$className] = $this->connection->selectDatabase($db);
     return $this->documentDatabases[$className];
 }
Esempio n. 2
0
 /**
  * Checks whether filter with given name is defined.
  *
  * @param string $name Name of the filter.
  * @return bool true if the filter exists, false if not.
  */
 public function has($name)
 {
     return null !== $this->config->getFilterClassName($name);
 }