当前位置: 首页>>代码示例>>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;未经允许,请勿转载。