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


PHP pdo::getScope方法代碼示例

本文整理匯總了PHP中pdo::getScope方法的典型用法代碼示例。如果您正苦於以下問題:PHP pdo::getScope方法的具體用法?PHP pdo::getScope怎麽用?PHP pdo::getScope使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pdo的用法示例。


在下文中一共展示了pdo::getScope方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: pdoToBean

 /**
  * Converts the given Person PDO to a bean object.
  * This includes the conversion from nested lists
  * of PDO objects to usable lists of oids/names to be used
  * by the page renderer.
  * 
  * @access private
  * @param pdo $pdo Person
  * @return bean Person
  */
 private function pdoToBean($pdo)
 {
     global $logger;
     $logger->debug(get_class($this) . "::pdoToBean({$pdo})");
     // if this is an artist, be sure to get the artist PDO not the person
     $scope = $pdo->getScope();
     $id = $pdo->getOid();
     if ($scope == 'Artist') {
         $epm = epManager::instance();
         $pdo = $epm->get('Artist', $id);
     }
     $bean = new $scope($pdo->epGetVars());
     // pubState to a string
     $ps = '';
     if ($pdo->getPubState() != null) {
         $ps = $pdo->getPubState()->getValue();
     }
     $bean->setPubState($ps);
     // if it is an artist, convert the exhibitions
     if (get_class($bean) == 'Artist') {
         $exhibitions = $pdo->exhibitions;
         if ($exhibitions) {
             $related = array();
             foreach ($exhibitions as $event) {
                 $related[] = new Exhibition($event->epGetVars());
             }
             $bean->setExhibitions($related);
         }
     }
     return $bean;
 }
開發者ID:justinlyon,項目名稱:scc,代碼行數:41,代碼來源:PersonService.php


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