本文整理匯總了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;
}