/** * Entirely redo discrimination on a tank_source * * @param TankSource $rec */ private function _redo_discrimination($rec) { $valid = array(TankSource::$STATUS_ERROR, TankSource::$STATUS_CONFLICT); if (!in_array($rec->tsrc_status, $valid)) { $msg = 'Must be in ERROR or CONFLICT status to use redo'; throw new Rframe_Exception(Rframe::BAD_DATA, $msg); } // reset tank_source entirely (BUT to error --- avoid NEW status) $rec->tsrc_status = TankSource::$STATUS_ERROR; $rec->tsrc_errors = null; $this->air_save($rec); // call perl discriminator try { CallPerl::set_env('REMOTE_USER='******'AIR2::TankSource->discriminate', $rec->tsrc_id); } catch (PerlException $e) { throw new Rframe_Exception(Rframe::BAD_DATA, $e->getMessage()); } }