本文整理匯總了PHP中Resource::getResourceByTitle方法的典型用法代碼示例。如果您正苦於以下問題:PHP Resource::getResourceByTitle方法的具體用法?PHP Resource::getResourceByTitle怎麽用?PHP Resource::getResourceByTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Resource
的用法示例。
在下文中一共展示了Resource::getResourceByTitle方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Resource
<?php
//used to verify resource name/title isn't already being used as it's added
$name = $_GET['name'];
$resource = new Resource();
if ($name) {
echo count($resource->getResourceByTitle($name));
}
示例2: ResourceOrganizationLink
if ($organizationID && $roleID) {
$organizationLink = new ResourceOrganizationLink();
$organizationLink->organizationRoleID = $roleID;
$organizationLink->resourceID = $resource->resourceID;
$organizationLink->organizationID = $organizationID;
$organizationLink->save();
}
}
} elseif ($deduping_count == 1) {
$resources = $resourceObj->getResourceByIsbnOrISSN($deduping_values);
$resource = $resources[0];
}
// Do we have a parent resource to create?
if ($data[$_POST['parentResource']] && ($deduping_count == 0 || $deduping_count == 1)) {
// Search if such parent exists
$numberOfParents = count($resourceObj->getResourceByTitle($data[$_POST['parentResource']]));
$parentID = null;
if ($numberOfParents == 0) {
// If not, create parent
$parentResource = new Resource();
$parentResource->createLoginID = $loginID;
$parentResource->createDate = date('Y-m-d');
$parentResource->titleText = $data[$_POST['parentResource']];
$parentResource->statusID = 1;
$parentResource->save();
$parentID = $parentResource->resourceID;
$parentInserted++;
} elseif ($numberOfParents == 1) {
// Else, attach the resource to its parent.
$parentResource = $resourceObj->getResourceByTitle($data[$_POST['parentResource']]);
$parentID = $parentResource[0]->resourceID;
示例3: elseif
$organizationLink->resourceID = $resource->resourceID;
$organizationLink->organizationID = $organizationID;
$organizationLink->save();
}
}
} elseif ($deduping_count == 1) {
$resources = $resourceObj->getResourceByIsbnOrISSN($deduping_values);
$resource = $resources[0];
}
foreach ($jsonData['parent'] as $parent) {
if ($parent === "") {
continue;
}
if ($data[intval($parent) - 1] && ($deduping_count == 0 || $deduping_count == 1)) {
// Search if such parent exists
$numberOfParents = count($resourceObj->getResourceByTitle($data[intval($parent) - 1]));
$parentID = null;
if ($numberOfParents == 0) {
// If not, create parent
$parentResource = new Resource();
$parentResource->createLoginID = $loginID;
$parentResource->createDate = date('Y-m-d');
$parentResource->titleText = $data[intval($parent) - 1];
$parentResource->statusID = 1;
$parentResource->save();
$parentID = $parentResource->resourceID;
$parentInserted++;
} elseif ($numberOfParents == 1) {
// Else, attach the resource to its parent.
$parentResource = $resourceObj->getResourceByTitle($data[intval($parent) - 1]);
$parentID = $parentResource[0]->resourceID;