本文整理汇总了PHP中Schema::setBaseDomain方法的典型用法代码示例。如果您正苦于以下问题:PHP Schema::setBaseDomain方法的具体用法?PHP Schema::setBaseDomain怎么用?PHP Schema::setBaseDomain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schema
的用法示例。
在下文中一共展示了Schema::setBaseDomain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setDefaults
/**
* Set defaults
*
* @param Schema $schema
*/
public function setDefaults($schema)
{
$baseDomain = $this->getRequest()->getUriPrefix() . '/uri';
$schema->setBaseDomain($baseDomain . "/schema/");
$schema->setLanguage(sfConfig::get('app_default_language'));
$schema->setProfileId(sfConfig::get('app_schema_profile_id'));
parent::setDefaults($schema);
}
示例2: run_import_list
//.........这里部分代码省略.........
switch ($fileType) {
case "csv":
try {
$reader = new aCsvReader($filePath);
} catch(Exception $e) {
throw new Exception("Not a happy CSV file! Error: " . $e);
}
$uploadPath = $GLOBALS['uploadPath'];
;
if ('vocab' == $type) {
// Get array of heading names found
$headings = $reader->getHeadings();
$fields = VocabularyPeer::getFieldNames();
try {
while ($row = $reader->getRow()) {
// lookup the URI (or the OMR ID if available) for a match
if (empty($row["VES"])) {
//skip this one
break;
}
$uri = $baseDomain . $row["VES"] . "#";
$vocab = VocabularyPeer::getVocabularyByUri($uri);
$updateTime = time();
if (! $vocab) {
// create a new concept or element
$vocab = new Vocabulary();
$vocab->setUri($uri);
$vocab->setCreatedAt($updateTime);
$vocab->setCreatedUserId($userId);
$vocab->setAgentId($agentID);
$vocab->setBaseDomain($baseDomain);
$vocab->setCommunity("Libraries, MARC21");
$vocab->setLanguage("en");
$vocab->setStatusId(1);
} else {
$vocab->setLastUpdated($updateTime);
$vocab->setUpdatedUserId($userId);
}
$vocab->setName(fixEncoding(rtrim($row['Name'])));
$vocab->setNote(fixEncoding(rtrim($row['Note'])));
$vocab->setToken($row['VES']);
$vocab->save();
//type
$args[0] = "vocab";
//vocabid
$args[2] = $vocab->getId();
//filepath
$args[1] = $GLOBALS['uploadPath'] . $row['VES'] . ".csv";
$args[3] = $batchId;
$args[4] = "-d";
run_import_vocabulary($importTask, $args);
$foo = $vocab->countConcepts();
}
} catch(Exception $e) {
throw new Exception($e);
}
} else //it's a schema
{
try {
while ($row = $reader->getRow()) {