public function ContentEntity::getDatabaseConnection in Search API 8
Retrieves the database connection.
Return value
\Drupal\Core\Database\Connection The database connection.
File
- src/
Plugin/ search_api/ datasource/ ContentEntity.php, line 184
Class
- ContentEntity
- Represents a datasource which exposes the content entities.
Namespace
Drupal\search_api\Plugin\search_api\datasourceCode
public function getDatabaseConnection() : Connection {
return $this->database ?: \Drupal::database();
}