public function addToEditArray($mode, &$arr, &$defaults, &$error, $fieldprefix) { if ($this->createDestination()) { // check if destination table is empty // only check if hidewhenempty is set to true if ($this->m_hidewhenempty) { $recs = $this->_getSelectableRecords($defaults, $mode); if (count($recs) == 0) { return $this->hide($defaults, $fieldprefix, $mode); } } } parent::addToEditArray($mode, $arr, $defaults, $error, $fieldprefix); }