server/src/app/Libraries/CocoonUtils.php
changeset 502 74fba571487e
parent 308 e032d686d88e
child 504 4ab820b387da
equal deleted inserted replaced
501:7b2dcd2b31c1 502:74fba571487e
    31         'http://www.language-archives.org/OLAC/1.1/transcriber',
    31         'http://www.language-archives.org/OLAC/1.1/transcriber',
    32         'http://www.language-archives.org/OLAC/1.1/translator',
    32         'http://www.language-archives.org/OLAC/1.1/translator',
    33     ];
    33     ];
    34 
    34 
    35     /**
    35     /**
    36      * Extract id form cocoon url.
    36      * Extract id from cocoon url.
    37      *
    37      *
    38      * @return string
    38      * @return string
    39      */
    39      */
    40     public static function getIdFromUri($uri) {
    40     public static function getIdFromUri($uri) {
    41         return config('corpusparole.corpus_id_scheme').substr($uri, strlen(config('corpusparole.cocoon_doc_id_base_uri')));
    41         return config('corpusparole.corpus_id_scheme').substr($uri, strlen(config('corpusparole.cocoon_doc_id_base_uri')));
       
    42     }
       
    43 
       
    44     /**
       
    45      * Extract Cocoon id from Cocoon url.
       
    46      *
       
    47      * @return string
       
    48      */
       
    49     public static function getCocoonIdFromCorpusUri($uri) {
       
    50         return substr($uri, strlen(config('corpusparole.cocoon_doc_id_base_uri')));
    42     }
    51     }
    43 
    52 
    44     /**
    53     /**
    45      * Extract id form corpus url.
    54      * Extract id form corpus url.
    46      *
    55      *