本文整理汇总了PHP中Resource::setIsbnOrIssn方法的典型用法代码示例。如果您正苦于以下问题:PHP Resource::setIsbnOrIssn方法的具体用法?PHP Resource::setIsbnOrIssn怎么用?PHP Resource::setIsbnOrIssn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Resource
的用法示例。
在下文中一共展示了Resource::setIsbnOrIssn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
// Convert to UTF-8
$data = array_map(function ($row) {
return mb_convert_encoding($row, 'UTF-8');
}, $data);
// Let's insert data
$resource->createLoginID = $loginID;
$resource->createDate = date('Y-m-d');
$resource->updateLoginID = '';
$resource->updateDate = '';
$resource->titleText = $data[$_POST['titleText']];
$resource->resourceURL = $data[$_POST['resourceURL']];
$resource->resourceAltURL = $data[$_POST['resourceAltURL']];
$resource->providerText = $data[$_POST['providerText']];
$resource->statusID = 1;
$resource->save();
$resource->setIsbnOrIssn($deduping_values);
$inserted++;
// Do we have to create an organization or attach the resource to an existing one?
if ($data[$_POST['organization']]) {
$organizationName = $data[$_POST['organization']];
$organization = new Organization();
$organizationRole = new OrganizationRole();
$organizationID = false;
// If we use the Organizations module
if ($config->settings->organizationsModule == 'Y') {
$dbName = $config->settings->organizationsDatabaseName;
// Does the organization already exists?
$query = "SELECT count(*) AS count FROM {$dbName}.Organization WHERE UPPER(name) = '" . str_replace("'", "''", strtoupper($organizationName)) . "'";
$result = $organization->db->processQuery($query, 'assoc');
// If not, we try to create it
if ($result['count'] == 0) {
示例2: Resource
<?php
$resourceID = $_POST['resourceID'];
//get this resource
$resource = new Resource(new NamedArguments(array('primaryKey' => $resourceID)));
$resource->updateLoginID = $loginID;
$resource->updateDate = date('Y-m-d H:i:s');
$resource->titleText = $_POST['titleText'];
$resource->descriptionText = $_POST['descriptionText'];
$resource->resourceFormatID = $_POST['resourceFormatID'];
$resource->resourceTypeID = $_POST['resourceTypeID'];
$resource->resourceURL = $_POST['resourceURL'];
$resource->resourceAltURL = $_POST['resourceAltURL'];
$isbnarray = json_decode($_POST['isbnOrISSN']);
$resource->setIsbnOrIssn($isbnarray);
//to determine status id
$status = new Status();
if ((!$resource->archiveDate || $resource->archiveDate == '0000-00-00') && $_POST['archiveInd'] == "1") {
$resource->archiveDate = date('Y-m-d');
$resource->archiveLoginID = $loginID;
$resource->statusID = $status->getIDFromName('archive');
} else {
if ($_POST['archiveInd'] == "0") {
//if archive date is currently set and being removed, mark status as complete
if ($resource->archiveDate != '' && $resource->archiveDate != '0000-00-00') {
$resource->statusID = $status->getIDFromName('complete');
}
$resource->archiveDate = '';
$resource->archiveLoginID = '';
}
}
示例3: date
}
// Let's insert data
$resource->createLoginID = $loginID;
$resource->createDate = date('Y-m-d');
$resource->updateLoginID = '';
$resource->updateDate = '';
$resource->titleText = trim($data[$resourceTitleColumn]);
$resource->descriptionText = trim($data[$resourceDescColumn]);
$resource->resourceURL = trim($data[$resourceURLColumn]);
$resource->resourceAltURL = trim($data[$resourceAltURLColumn]);
$resource->resourceTypeID = $resourceTypeID;
$resource->resourceFormatID = $resourceFormatID;
//$resource->providerText = $data[$_POST['providerText']];
$resource->statusID = 1;
$resource->save();
$resource->setIsbnOrIssn($isbnIssn_values);
$inserted++;
// If Alias is mapped, check to see if it exists
foreach ($jsonData['alias'] as $alias) {
if ($alias['column'] === "") {
continue;
}
if ($alias['delimiter'] !== "") {
$aliasArray = array_map('trim', explode($alias['delimiter'], $data[intval($alias['column']) - 1]));
} else {
$aliasArray = array(trim($data[intval($alias['column']) - 1]));
}
foreach ($aliasArray as $currentAlias) {
if ($currentAlias === $resource->titleText) {
continue;
}