/** * @return APF_AMQP_Factory */ public static function &get_instance() { if (!self::$instance) { self::$instance = new APF_Amqp_Factory(); } return self::$instance; }
public function delete() { if ($this->is_loaded == false) { return false; } try { $msg = $this->build_delete(); $con = APF_AMQP_Factory::get_instance()->get_connection(); $ex = new AMQPExchange($con, self::get_exchange()); $ex->publish($msg, self::get_routing()); } catch (Exception $e) { APF::get_instance()->get_debugger()->debug('AMPQ: Can not be published - ' . $e->getMessage()); } return true; }