Open Data Catalog v2.0.0
Drupal\dkan_harvest\Harvester Class Reference

Public Member Functions

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

Protected Member Functions

 getDkanHarvesterInstance ($harvestPlan, $item_store, $hash_store)
 

Detailed Description

Harvester.

Definition at line 14 of file Harvester.php.

Constructor & Destructor Documentation

◆ __construct()

Drupal\dkan_harvest\Harvester::__construct ( FactoryInterface  $storeFactory)

Constructor.

Definition at line 21 of file Harvester.php.

Member Function Documentation

◆ deregisterHarvest()

Drupal\dkan_harvest\Harvester::deregisterHarvest ( string  $id)

Deregister harvest.

Parameters
string$idId.
Returns
bool Boolean.

Definition at line 93 of file Harvester.php.

◆ getAllHarvestIds()

Drupal\dkan_harvest\Harvester::getAllHarvestIds ( )

Get all available harvests.

Returns
array All ids.

Definition at line 31 of file Harvester.php.

◆ getAllHarvestRunInfo()

Drupal\dkan_harvest\Harvester::getAllHarvestRunInfo (   $id)

Public.

Definition at line 152 of file Harvester.php.

◆ getDkanHarvesterInstance()

Drupal\dkan_harvest\Harvester::getDkanHarvesterInstance (   $harvestPlan,
  $item_store,
  $hash_store 
)
protected

Protected.

@codeCoverageIgnore

Definition at line 187 of file Harvester.php.

◆ getHarvestPlan()

Drupal\dkan_harvest\Harvester::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 51 of file Harvester.php.

◆ getHarvestRunInfo()

Drupal\dkan_harvest\Harvester::getHarvestRunInfo (   $id,
  $runId 
)

Get Harvest Run Info.

Returns
mixed FALSE if no matching runID is found.

Definition at line 137 of file Harvester.php.

◆ registerHarvest()

Drupal\dkan_harvest\Harvester::registerHarvest (   $plan)

Register a new harvest plan.

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

Definition at line 72 of file Harvester.php.

◆ revertHarvest()

Drupal\dkan_harvest\Harvester::revertHarvest (   $id)

Public.

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

Definition at line 106 of file Harvester.php.

◆ runHarvest()

Drupal\dkan_harvest\Harvester::runHarvest (   $id)

Public.

Definition at line 119 of file Harvester.php.

◆ validateHarvestPlan()

Drupal\dkan_harvest\Harvester::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 167 of file Harvester.php.