本文整理汇总了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;