Open Data Catalog v2.0.0
Drupal\dkan_common\Storage\AbstractDatabaseTable Class Reference
Inheritance diagram for Drupal\dkan_common\Storage\AbstractDatabaseTable:
Drupal\dkan_datastore\Storage\DatabaseTable Drupal\dkan_datastore\Storage\JobStore Drupal\dkan_harvest\Storage\DatabaseTable

Public Member Functions

 __construct (Connection $connection)
 
 retrieve (string $id)
 
 retrieveAll ()
 
 store ($data, string $id=NULL)
 
 storeMultiple (array $data)
 
 remove (string $id)
 
 count ()
 
 query (Query $query)
 
 destroy ()
 

Protected Member Functions

 getTableName ()
 
 prepareData (string $data, string $id=NULL)
 
 primaryKey ()
 
 getNonSerialFields ()
 

Protected Attributes

 $connection
 

Detailed Description

AbstractDatabaseTable class.

Definition at line 16 of file AbstractDatabaseTable.php.

Constructor & Destructor Documentation

◆ __construct()

Drupal\dkan_common\Storage\AbstractDatabaseTable::__construct ( Connection  $connection)

Constructor.

Parameters
\Drupal\Core\Database\Connection$connectionDrupal database connection object.

Definition at line 49 of file AbstractDatabaseTable.php.

Member Function Documentation

◆ count()

Drupal\dkan_common\Storage\AbstractDatabaseTable::count ( )

Count rows in table.

Definition at line 192 of file AbstractDatabaseTable.php.

◆ destroy()

Drupal\dkan_common\Storage\AbstractDatabaseTable::destroy ( )

Destroy.

Drop the database table.

Definition at line 241 of file AbstractDatabaseTable.php.

◆ getNonSerialFields()

Drupal\dkan_common\Storage\AbstractDatabaseTable::getNonSerialFields ( )
protected

Private.

Reimplemented in Drupal\dkan_datastore\Storage\DatabaseTable.

Definition at line 167 of file AbstractDatabaseTable.php.

◆ getTableName()

Drupal\dkan_common\Storage\AbstractDatabaseTable::getTableName ( )
abstractprotected

Get the full name of datastore db table.

Returns
string Table name.

Reimplemented in Drupal\dkan_datastore\Storage\DatabaseTable, Drupal\dkan_harvest\Storage\DatabaseTable, and Drupal\dkan_datastore\Storage\JobStore.

◆ prepareData()

Drupal\dkan_common\Storage\AbstractDatabaseTable::prepareData ( string  $data,
string  $id = NULL 
)
abstractprotected

Prepare data.

Transform the string data given into what should be use by the insert query.

Reimplemented in Drupal\dkan_datastore\Storage\DatabaseTable, Drupal\dkan_datastore\Storage\JobStore, and Drupal\dkan_harvest\Storage\DatabaseTable.

◆ primaryKey()

Drupal\dkan_common\Storage\AbstractDatabaseTable::primaryKey ( )
abstractprotected

◆ query()

Drupal\dkan_common\Storage\AbstractDatabaseTable::query ( Query  $query)

Run a query on the database table.

Parameters
\Drupal\dkan_datastore\Storage\Query$queryQuery obejct.

Definition at line 204 of file AbstractDatabaseTable.php.

◆ remove()

Drupal\dkan_common\Storage\AbstractDatabaseTable::remove ( string  $id)

Inherited.

@inheritDoc

Definition at line 182 of file AbstractDatabaseTable.php.

◆ retrieve()

Drupal\dkan_common\Storage\AbstractDatabaseTable::retrieve ( string  $id)

Inherited.

@inheritDoc

Reimplemented in Drupal\dkan_harvest\Storage\DatabaseTable, and Drupal\dkan_datastore\Storage\JobStore.

Definition at line 62 of file AbstractDatabaseTable.php.

◆ retrieveAll()

Drupal\dkan_common\Storage\AbstractDatabaseTable::retrieveAll ( )

Inherited.

@inheritDoc

Definition at line 82 of file AbstractDatabaseTable.php.

◆ store()

Drupal\dkan_common\Storage\AbstractDatabaseTable::store (   $data,
string  $id = NULL 
)

Store data.

Definition at line 105 of file AbstractDatabaseTable.php.

◆ storeMultiple()

Drupal\dkan_common\Storage\AbstractDatabaseTable::storeMultiple ( array  $data)

Prepare to store possibly multiple values.

Parameters
array$dataArray of values to be inserted into the database.
Returns
string Last record id inserted into the database.

Definition at line 146 of file AbstractDatabaseTable.php.

Member Data Documentation

◆ $connection

Drupal\dkan_common\Storage\AbstractDatabaseTable::$connection
protected

Definition at line 20 of file AbstractDatabaseTable.php.