kernel/classes/datatypes/ezurl/ezurl.php
static function registerURL( $url )
    {
        $urlID = null;
        $urlObject = self::fetchByUrl( $url );

        if ( !$urlObject instanceof eZURL )
        {
            // store URL
            $urlObject = self::create( $url );
            $urlObject->store();
            $urlID = $urlObject->attribute( 'id' );
        }
        else
        {
            // Mismatch => most likely case sensitivity difference, so update the url
            if ( $urlObject->attribute( 'url' ) !== $url )
            {
                $urlObject->setAttribute( 'url', $url );
                $urlObject->setAttribute( 'original_url_md5', md5( $url ) );
                $urlObject->setAttribute( 'modified', time() );
                $urlObject->store( array( 'url', 'original_url_md5', 'modified' ) );
            }

            $urlID = $urlObject->attribute( 'id' );
        }

        return $urlID;
    }
static function registerURL( $url )
    {
        $urlID = null;
        $urlObject = self::fetchByUrl( $url );

        if ( !$urlObject instanceof eZURL )
        {
            // store URL
            $urlObject = self::create( $url );
            $urlObject->store();
            $urlID = $urlObject->attribute( 'id' );
        }
        else
        {
            // Mismatch => most likely case sensitivity difference, so update the url
            if ( $urlObject->attribute( 'url' ) !== $url )
            {
                $urlObject->setAttribute( 'url', $url );
                $urlObject->setAttribute( 'original_url_md5', md5( $url ) );
                $urlObject->setAttribute( 'modified', time() );
                $urlObject->store( array( 'url', 'original_url_md5', 'modified' ) );
            }

            $urlID = $urlObject->attribute( 'id' );
        }

        return $urlID;
    }
static function registerURL ( $ url ) { $ urlID = null ; $ urlObject = self :: fetchByUrl ( $ url ) ; if ( ! $ urlObject instanceof eZURL ) { // store URL $ urlObject = self :: create ( $ url ) ; $ urlObject -> store ( ) ; $ urlID = $ urlObject -> attribute ( 'id' ) ; } else { // Mismatch => most likely case sensitivity difference, so update the url if ( $ urlObject -> attribute ( 'url' ) !== $ url ) { $ urlObject -> setAttribute ( 'url' , $ url ) ; $ urlObject -> setAttribute ( 'original_url_md5' , md5 ( $ url ) ) ; $ urlObject -> setAttribute ( 'modified' , time ( ) ) ; $ urlObject -> store ( array ( 'url' , 'original_url_md5' , 'modified' ) ) ; } $ urlID = $ urlObject -> attribute ( 'id' ) ; } return $ urlID ; }
Registers an URL to the URL database and returns the URL id.
If URL is already present, the method will check the checksum and update the URL if needed
@param string $url
@return int
Registers an URL to the URL database and returns the URL id . If URL is already present the method will check the checksum and update the URL if needed