protected function buildUpdateStruct(URL $url, URLUpdateStruct $data)
    {
        $updateStruct = new SPIUrlUpdateStruct();

        if ($data->url !== null && $url->url !== $data->url) {
            $updateStruct->url = $data->url;
            // Reset URL validity
            $updateStruct->lastChecked = 0;
            $updateStruct->isValid = true;
        } else {
            $updateStruct->url = $url->url;

            if ($data->lastChecked !== null) {
                $updateStruct->lastChecked = $data->lastChecked->getTimestamp();
            } elseif ($data->lastChecked !== null) {
                $updateStruct->lastChecked = $url->lastChecked->getTimestamp();
            } else {
                $updateStruct->lastChecked = 0;
            }

            if ($data->isValid !== null) {
                $updateStruct->isValid = $data->isValid;
            } else {
                $updateStruct->isValid = $url->isValid;
            }
        }

        return $updateStruct;
    }
protected function buildUpdateStruct(URL $url, URLUpdateStruct $data)
    {
        $updateStruct = new SPIUrlUpdateStruct();

        if ($data->url !== null && $url->url !== $data->url) {
            $updateStruct->url = $data->url;
            // Reset URL validity
            $updateStruct->lastChecked = 0;
            $updateStruct->isValid = true;
        } else {
            $updateStruct->url = $url->url;

            if ($data->lastChecked !== null) {
                $updateStruct->lastChecked = $data->lastChecked->getTimestamp();
            } elseif ($data->lastChecked !== null) {
                $updateStruct->lastChecked = $url->lastChecked->getTimestamp();
            } else {
                $updateStruct->lastChecked = 0;
            }

            if ($data->isValid !== null) {
                $updateStruct->isValid = $data->isValid;
            } else {
                $updateStruct->isValid = $url->isValid;
            }
        }

        return $updateStruct;
    }
protected function buildUpdateStruct ( URL $ url , URLUpdateStruct $ data ) { $ updateStruct = new SPIUrlUpdateStruct ( ) ; if ( $ data -> url !== null && $ url -> url !== $ data -> url ) { $ updateStruct -> url = $ data -> url ; // Reset URL validity $ updateStruct -> lastChecked = 0 ; $ updateStruct -> isValid = true ; } else { $ updateStruct -> url = $ url -> url ; if ( $ data -> lastChecked !== null ) { $ updateStruct -> lastChecked = $ data -> lastChecked -> getTimestamp ( ) ; } elseif ( $ data -> lastChecked !== null ) { $ updateStruct -> lastChecked = $ url -> lastChecked -> getTimestamp ( ) ; } else { $ updateStruct -> lastChecked = 0 ; } if ( $ data -> isValid !== null ) { $ updateStruct -> isValid = $ data -> isValid ; } else { $ updateStruct -> isValid = $ url -> isValid ; } } return $ updateStruct ; }
Builds SPI update structure used by Persistence API.

@param \eZ\Publish\API\Repository\Values\URL\URL $url
@param \eZ\Publish\API\Repository\Values\URL\URLUpdateStruct $data
@return \eZ\Publish\SPI\Persistence\URL\URLUpdateStruct
Builds SPI update structure used by Persistence API .