本文整理汇总了PHP中pdo::getOid方法的典型用法代码示例。如果您正苦于以下问题:PHP pdo::getOid方法的具体用法?PHP pdo::getOid怎么用?PHP pdo::getOid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pdo
的用法示例。
在下文中一共展示了pdo::getOid方法的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;
}