function farm_constraint_table_references_exist in farmOS 7
Helper function for checking to see if an entity reference exists in a database table.
Parameters
$references: See farm_constraint_table_references() below.
$type: The entity type.
$bundle: The entity bundle.
$id: The entity ID.
Return value
bool Returns TRUE if a constraint was found, FALSE otherwise.
File
- modules/
farm/ farm_constraint/ farm_constraint.module, line 86 - Farm constraint module.
Code
function farm_constraint_table_references_exist($references, $type, $bundle, $id) {
// Get a list of matching records.
$records = farm_constraint_table_references($references, $type, $bundle, $id);
// If records were found, return TRUE. Otherwise, return FALSE.
if (!empty($records)) {
return TRUE;
}
return FALSE;
}