當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Resource::getResourceByTitle方法代碼示例

本文整理匯總了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));
}
開發者ID:billdueber,項目名稱:resources,代碼行數:8,代碼來源:getExistingTitle.php

示例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;
開發者ID:jsteverman,項目名稱:resources,代碼行數:31,代碼來源:import.php

示例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;
開發者ID:pontifechs,項目名稱:resources,代碼行數:31,代碼來源:import.php


注:本文中的Resource::getResourceByTitle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。