<<

NAME

ProductOpener::PackagingFoodContact

SYNOPSIS

DESCRIPTION

FUNCTIONS

determine_food_contact_of_packaging_components_service ( $product_ref, $updated_product_fields_ref, $errors_ref )

Determine if packaging components are in contact with the food.

This function is a product service that can be run through ProductOpener::ApiProductServices

Arguments

$product_ref

product object reference

$updated_product_fields_ref

reference to a hash of product fields that have been created or updated

$errors_ref

reference to an array of error messages

get_matching_and_non_matching_packaging_components ($packagings_ref, $conditions_ref)

Find packaging components that match specific conditions (e.g material, shape, recycling). Conditions are matched using the taxonomy, a parent in the condition matches more specific children. (e.g. "en:plastic" matches "en:pet" and "en:hdpe")

Parameters

$packaging_ref packaging data

$conditions_ref conditions

Hash reference with conditions like material, shape, recycling as keys, and a value or an array of values as values.

Return values

Array with: - a reference to an array of packaging components that match the conditions, - a reference to an array of packaging components that do not match the conditions.

determine_food_contact_of_packaging_components ($packagings_ref)

Determine if packaging components are in contact with the food.

Parameters

$packagings_ref packaging data

<<