/** * Check if the relation is empty. * * @param array $record The record to check * * @return bool true if a destination record is present. False if not. */ public function isEmpty($record) { if ($this->createDestination() && isset($record[$this->fieldName()][$this->m_destInstance->primaryKeyField()])) { return empty($record[$this->fieldName()][$this->m_destInstance->primaryKeyField()]); } else { if ($this->createDestination() && isset($record[$this->fieldName()])) { return empty($record[$this->fieldName()]); } } return true; // always empty if error. }