Skip to content

Commit

Permalink
Better docs for DatabaseTableFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeder committed Jan 8, 2025
1 parent f7aa9bd commit 2594e68
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions modules/datastore/src/Storage/DatabaseTableFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ public function __construct(
}

/**
* Inherited.
* Get a DatabaseTable instance.
*
* @inheritdoc
* @param string $identifier
* Some way to discern between different instances of a class.
* @param array $config
* Must contain a 'resource' key, which is a DataResource object.
*
* @return \Drupal\datastore\Storage\DatabaseTable
* A DatabaseTable object.
*/
public function getInstance(string $identifier, array $config = []) {
if (!isset($config['resource'])) {
Expand All @@ -50,7 +56,13 @@ public function getInstance(string $identifier, array $config = []) {
}

/**
* Protected.
* Get a DatabaseTable object from a DataResource object.
*
* @param \Drupal\common\DataResource $resource
* A resource.
*
* @return \Drupal\datastore\Storage\DatabaseTable
* A DatabaseTable object.
*/
protected function getDatabaseTable($resource) {
return new DatabaseTable($this->connection, $resource, $this->logger);
Expand Down

0 comments on commit 2594e68

Please sign in to comment.