webservice = $webservice; $this->devicePostUrl = $devicePostUrl; } /** * @param LifecycleEventArgs $args */ public function postPersist(LifecycleEventArgs $args) { $entity = $args->getEntity(); if ($entity instanceof DeviceInterface) { $data = array( 'deviceType' => get_class($entity), 'deviceId' => $entity->getId(), 'ip' => $entity->getIp(), ); $result = $this->webservice->makeGetRequest($this->devicePostUrl, HttpRequestInterface::METHOD_POST, $data); } } }