Open Data Catalog v2.0.0
Drupal\harvest\Service Class Reference
Inheritance diagram for Drupal\harvest\Service:

Public Member Functions

 __construct (FactoryInterface $storeFactory, Metastore $metastore, EntityTypeManager $entityTypeManager)
 
 getAllHarvestIds ()
 
 getHarvestPlan ($plan_id)
 
 registerHarvest ($plan)
 
 deregisterHarvest (string $id)
 
 revertHarvest ($id)
 
 runHarvest ($id)
 
 getHarvestRunInfo ($id, $runId)
 
 getAllHarvestRunInfo ($id)
 
 publish (string $id)
 
 validateHarvestPlan ($plan)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Member Functions

 getDkanHarvesterInstance ($harvestPlan, $item_store, $hash_store)
 

Detailed Description

Service.

Definition at line 19 of file Service.php.

Constructor & Destructor Documentation

◆ __construct()

Drupal\harvest\Service::__construct ( FactoryInterface  $storeFactory,
Metastore  $metastore,
EntityTypeManager  $entityTypeManager 
)

Constructor.

Definition at line 56 of file Service.php.

Member Function Documentation

◆ create()

static Drupal\harvest\Service::create ( ContainerInterface  $container)
static

Create.

Definition at line 45 of file Service.php.

◆ deregisterHarvest()

Drupal\harvest\Service::deregisterHarvest ( string  $id)

Deregister harvest.

Parameters
string$idId.
Returns
bool Boolean.

Definition at line 130 of file Service.php.

◆ getAllHarvestIds()

Drupal\harvest\Service::getAllHarvestIds ( )

Get all available harvests.

Returns
array All ids.

Definition at line 68 of file Service.php.

◆ getAllHarvestRunInfo()

Drupal\harvest\Service::getAllHarvestRunInfo (   $id)

Public.

Definition at line 198 of file Service.php.

◆ getDkanHarvesterInstance()

Drupal\harvest\Service::getDkanHarvesterInstance (   $harvestPlan,
  $item_store,
  $hash_store 
)
protected

Protected.

@codeCoverageIgnore

Definition at line 303 of file Service.php.

◆ getHarvestPlan()

Drupal\harvest\Service::getHarvestPlan (   $plan_id)

Return a harvest plan.

Parameters
string$plan_idThe harvest plan id.
Returns
mixed The harvest plan, if any, or NULL.
Exceptions

Definition at line 88 of file Service.php.

◆ getHarvestRunInfo()

Drupal\harvest\Service::getHarvestRunInfo (   $id,
  $runId 
)

Get Harvest Run Info.

Returns
mixed FALSE if no matching runID is found.

Definition at line 183 of file Service.php.

◆ publish()

Drupal\harvest\Service::publish ( string  $id)

Publish a harvest.

Parameters
string$idHarvest identifier.
Returns
array The uuids of the published datasets.

Definition at line 225 of file Service.php.

◆ registerHarvest()

Drupal\harvest\Service::registerHarvest (   $plan)

Register a new harvest plan.

Parameters
object$planusually an \stdClass representation.
Returns
string Identifier.
Exceptions

Definition at line 109 of file Service.php.

◆ revertHarvest()

Drupal\harvest\Service::revertHarvest (   $id)

Public.

Todo:
the destruct method should be part of some interface.

Definition at line 147 of file Service.php.

◆ runHarvest()

Drupal\harvest\Service::runHarvest (   $id)

Public.

Definition at line 160 of file Service.php.

◆ validateHarvestPlan()

Drupal\harvest\Service::validateHarvestPlan (   $plan)

Proxy to Etl Factory to validate harvest plan.

Parameters
object$planPlan.
Returns
bool Throws exceptions instead of false it seems.

Definition at line 283 of file Service.php.