当前位置: 首页>>代码示例>>PHP>>正文


PHP Schema::getUri方法代码示例

本文整理汇总了PHP中Schema::getUri方法的典型用法代码示例。如果您正苦于以下问题:PHP Schema::getUri方法的具体用法?PHP Schema::getUri怎么用?PHP Schema::getUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Schema的用法示例。


在下文中一共展示了Schema::getUri方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: retrievePrefixes

    public function retrievePrefixes()
    {
        $prefixes = $this->schema->getPrefixes();
        if ('schema' === $this->type) {
            $namespaces = \SchemaPropertyElementPeer::getNamespaceList($this->schema->getId());
        } else {
            $namespaces = \VocabularyPeer::getNamespaceList($this->schema->getId());
        }
        //check the retrieved namespaces for a match to existing prefixes
        foreach ($namespaces as $uri) {
            //if we find the uri in existing schema prefixes, move on
            if ($prefixes and array_search($uri, $prefixes) !== false) {
                continue;
            }
            //look for it in Prefixes table
            $namespacePrefix = \PrefixPeer::findByUri($uri);
            if ($namespacePrefix) {
                //add it to the prefix array
                $prefixes[ $namespacePrefix->getPrefix() ] = $uri;
            } //check it against the schema token
            elseif (trim($uri, "/#") == trim($this->schema->getUri(), "#/")) {
                $prefixes[ $this->schema->getToken() ] = $uri;
            } else {
                $prefixes[ ] = $uri;
            }
        }
        if (empty($prefixes)) {
            $prefixes = $this->getDefaultPrefix();
        }

        return $prefixes;
    }
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:32,代码来源:ExportVocab.php

示例2: saveResults

    public function saveResults($batchId = '')
    {
        $batchLog = new \BatchPeer();
        if ($batchId) {
            $criteria = new \Criteria();
            $criteria->add(\BatchPeer::ID, $batchId);
            /** @var $batch \Batch */
            $batch = $batchLog::doSelectOne($criteria);
        }

        if (empty( $batch )) {
            $batch = $batchLog->createBatchRecord(time(),
                                                  "manual import from file",
                                                  "schema",
                                                  "manual import (testing)",
                                                  "import",
                                                  $this->vocabId,
                                                  $this->vocabulary->getUri());
        }
        //there's a bunch more stuff we should save here
        $import = new \FileImportHistory();
        $import->setFileName($this->file);
        $import->setFileType($this->type);
        //todo $this->mapping isn't correct
        //$import->setMap($this->mapping);
        $import->setResults($this->results);
        $import->setUserId($this->userId);
        $import->setSchemaId($this->vocabId);
        $import->setBatch($batch);

        //$import->setBatch($batch);
        $import->save();

        return $batch->getId();
    }
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:35,代码来源:ImportVocab.php


注:本文中的Schema::getUri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。