/**
* Get the id of the employee relationship, checking it is valid.
+ * We check that contact_type_a is Individual, but not contact_type_b because there's
+ * nowhere in the code that requires it to be Organization.
*
* @return int|string
*
$relationship = RelationshipType::get(FALSE)
->addWhere('name_a_b', '=', 'Employee of')
->addWhere('contact_type_a', '=', 'Individual')
- ->addWhere('contact_type_b', '=', 'Organization')
->addSelect('id')->execute()->first();
if (empty($relationship)) {
throw new API_Exception('no valid relationship');