You are here

function farm_quick_entity_link in farmOS 7

Link an entity to a quick form.

Parameters

string $quick_form_id: The quick form ID.

string $entity_type: The entity type.

$entity: The entity.

7 calls to farm_quick_entity_link()
farm_crop_planting_quick_form_submit in modules/farm/farm_crop/farm_crop.farm_quick.planting.inc
Planting quick form submit.
farm_livestock_birth_form_submit in modules/farm/farm_livestock/farm_livestock.farm_quick.birth.inc
Submit callback for birth quick form.
farm_livestock_milk_form_submit in modules/farm/farm_livestock/farm_livestock.farm_quick.milk.inc
Submit function for milk quick form.
farm_livestock_move_form_submit in modules/farm/farm_livestock/farm_livestock.farm_quick.move.inc
Submit function for movement quick form.
farm_soil_amendment_form_submit in modules/farm/farm_soil/farm_soil.farm_quick.amendment.inc
Soil amendment quick form submit.

... See full list

6 string references to 'farm_quick_entity_link'
farm_crop_planting_quick_form_submit in modules/farm/farm_crop/farm_crop.farm_quick.planting.inc
Planting quick form submit.
farm_livestock_birth_form_submit in modules/farm/farm_livestock/farm_livestock.farm_quick.birth.inc
Submit callback for birth quick form.
farm_livestock_milk_form_submit in modules/farm/farm_livestock/farm_livestock.farm_quick.milk.inc
Submit function for milk quick form.
farm_livestock_move_form_submit in modules/farm/farm_livestock/farm_livestock.farm_quick.move.inc
Submit function for movement quick form.
farm_soil_amendment_form_submit in modules/farm/farm_soil/farm_soil.farm_quick.amendment.inc
Soil amendment quick form submit.

... See full list

File

modules/farm/farm_quick/farm_quick.module, line 252
Code for the Farm Quick module.

Code

function farm_quick_entity_link($quick_form_id, $entity_type, $entity) {

  // If no quick form ID is provided, bail.
  if (empty($quick_form_id)) {
    return;
  }

  // Get the entity ID.
  $id = entity_id($entity_type, $entity);

  // If the ID could not be found, bail.
  if (empty($id)) {
    return;
  }

  // Save it to the {farm_quick_entity} table.
  $record = array(
    'entity_type' => $entity_type,
    'entity_id' => $id,
    'quick_form_id' => $quick_form_id,
  );
  drupal_write_record('farm_quick_entity', $record);
}