protected function setUrlStatus(URL $url, $isValid)
    {
        try {
            $updateStruct = $this->urlService->createUpdateStruct();
            $updateStruct->isValid = $isValid;
            $updateStruct->lastChecked = new DateTime();

            $this->urlService->updateUrl($url, $updateStruct);

            $this->logger->info(sprintf('URL id = %d (%s) was checked (valid = %s)', $url->id, $url->url, (int) $isValid));
        } catch (Exception $e) {
            $this->logger->error(sprintf('Cannot update URL id = %d status: %s', $url->id, $url->url));
        }
    }
protected function setUrlStatus(URL $url, $isValid)
    {
        try {
            $updateStruct = $this->urlService->createUpdateStruct();
            $updateStruct->isValid = $isValid;
            $updateStruct->lastChecked = new DateTime();

            $this->urlService->updateUrl($url, $updateStruct);

            $this->logger->info(sprintf('URL id = %d (%s) was checked (valid = %s)', $url->id, $url->url, (int) $isValid));
        } catch (Exception $e) {
            $this->logger->error(sprintf('Cannot update URL id = %d status: %s', $url->id, $url->url));
        }
    }
protected function setUrlStatus ( URL $ url , $ isValid ) { try { $ updateStruct = $ this -> urlService -> createUpdateStruct ( ) ; $ updateStruct -> isValid = $ isValid ; $ updateStruct -> lastChecked = new DateTime ( ) ; $ this -> urlService -> updateUrl ( $ url , $ updateStruct ) ; $ this -> logger -> info ( sprintf ( 'URL id = %d (%s) was checked (valid = %s)' , $ url -> id , $ url -> url , ( int ) $ isValid ) ) ; } catch ( Exception $ e ) { $ this -> logger -> error ( sprintf ( 'Cannot update URL id = %d status: %s' , $ url -> id , $ url -> url ) ) ; } }
Sets URL status.

@param \eZ\Publish\API\Repository\Values\URL\URL $url
@param bool $isValid
Sets URL status .