/** * This handles connecting a attendee to related items when the chained flag is true. * * @since 4.3.0 * * @param EE_Attendee $attendee * @param array $args incoming arguments from caller for specifying overrides. * * @return EE_Attendee */ private function _maybe_chained(EE_Attendee $attendee, $args) { if ($this->_chained) { if (empty($this->_status)) { $this->_set_repeated_relation($args, $attendee->ID()); } //YES we DO want to set brand new relation objects because multiple attendees do not share the same related objects (for the purpose of tests at least) $this->_set_new_relations($args, $attendee->ID()); //note relation to registration should already be set via the factory->registration_chained->create() method. //add relation to status $attendee->_add_relation_to($this->_status, 'Status'); $attendee->save(); return $attendee; } return $attendee; }