public function init() { $this->_logger->log(__METHOD__); $this->settings = Settings::model()->find(); $this->_logger->log(__METHOD__ . $this->communication_type); $this->listener = Listener::getCurrent($this->source, $this->communication_type); $this->_logger->log(__METHOD__ . ': ' . print_r($this->listener, 1)); if (!$this->listener->started) { $this->listener->process_pid = getmypid(); $this->listener->started = time(); $this->listener->save(); Synchronization::trySetActualListenerId($this->source, $this->listener->listener_id); ListenerProcess::addComment($this->listener->listener_id, 'started', 'by ' . $this->by); } else { ListenerProcess::addComment($this->listener->listener_id, 'still_in_process'); } }