You are here

protected function FeedsDataHandler::joinedTableHandler in Feeds 6

Helper. Returns a joined table for a given table name that starts with a #.

@see: insert(), update().

Parameters

$name: Potential table name. If name does not start with a #, method will always return FALSE.

Return value

A DataHandler object if a joined table with this name could be found, FALSE otherwise. Returns FALSE if $name does not start with #.

Throws

Exception Throws Exception if a table name starting with # is given, but a DataHandler can't be found.

2 calls to FeedsDataHandler::joinedTableHandler()
FeedsDataHandler::insert in includes/FeedsDataHandler.inc
Inserts a multi dimensional record.
FeedsDataHandler::update in includes/FeedsDataHandler.inc
Updates a multi-dimensional record.

File

includes/FeedsDataHandler.inc, line 220
Data handler used in FeedsDataProcessor.

Class

FeedsDataHandler
Simple multidimensional data handler. Treats tables that join to this handler's table through FeedsDatahandler::key as a cluster. Records in this cluster are regarded as belonging to one multidimensional data set joined by FeedsDatahandler::key.

Code

protected function joinedTableHandler($name) {
  if (strpos($name, '#') === 0) {
    $name = substr($name, 1);
    if (in_array($name, $this->joined_tables)) {
      return data_get_handler($name);
    }
    throw new Exception(t('Data handler for table !name not found.', array(
      '!name' => $name,
    )));
  }
  return NULL;
}