本文整理汇总了PHP中pdo::getChildren方法的典型用法代码示例。如果您正苦于以下问题:PHP pdo::getChildren方法的具体用法?PHP pdo::getChildren怎么用?PHP pdo::getChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pdo
的用法示例。
在下文中一共展示了pdo::getChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: coursePdoToBean
/**
* Converts the given course 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 Course
* @return bean Course
*/
private function coursePdoToBean($pdo)
{
require_once WEB_INF . '/beans/Seminar.php';
global $logger;
$logger->debug(get_class($this) . "::coursePdoToBean({$pdo})");
$copyOption = new CopyBeanOption();
$copyOption->setUseTargetVars(true);
$copyOption->setScalarsOnly(true);
$bean = new Course($pdo->epGetVars());
// primaryGenre to bean
$genre = $pdo->getPrimaryGenre();
$ga = $genre != null ? $genre->epGetVars() : null;
$bean->setPrimaryGenre(new Genre($ga));
// pubState to a string
$ps = '';
if ($pdo->getPubState() != null) {
$ps = $pdo->getPubState()->getValue();
}
$bean->setPubState($ps);
// eventStatus to a string
$es = '';
if ($pdo->getEventStatus() != null) {
$es = $pdo->getEventStatus()->getValue();
}
$bean->setEventStatus($es);
// default venue from pdo to bean
$dven = $pdo->getDefaultVenue();
$logger->debug("Getting default venue from the course pdo: " . $pdo->getDefaultVenue());
$dv = $dven != null ? $dven->epGetVars() : null;
$bean->setDefaultVenue(new Venue($dv));
$logger->debug("Setting default venue in the course bean: " . $bean->getDefaultVenue()->getName());
// venues from array of pdos to array of venue bean
$vens = array();
if ($pdo->getVenues() != null) {
foreach ($pdo->getVenues() as $ven) {
$vens[] = new Venue($ven->epGetVars());
}
}
$bean->setVenues($vens);
// categories from array of pdos to keyed array of oids
$cats = array();
if ($pdo->getCategories() != null) {
foreach ($pdo->getCategories() as $cat) {
$scope = $cat->getScope();
$cats[$scope][] = new $scope($cat->epGetVars());
}
}
$bean->setCategories($cats);
// related exhibitions from array of pdos to keyed array of oids
$exhibitions = $pdo->getExhibitions();
if ($exhibitions != null) {
$related = array();
foreach ($exhibitions as $event) {
$related[] = new Exhibition($event->epGetVars());
}
$bean->setExhibitions($related);
}
// related programs from array of pdos to keyed array of oids
$programs = $pdo->getPrograms();
if ($programs != null) {
$related = array();
foreach ($programs as $event) {
$related[] = new Program($event->epGetVars());
}
$bean->setPrograms($related);
}
// related performances from array of pdos to array of activities
$children = $pdo->getChildren();
if ($children != null) {
$activities = array();
foreach ($children as $activity) {
$scope = $activity->getScope();
$perf = new $scope($activity->epGetVars());
$perf->setActivityStatus(new EventStatus($activity->getActivityStatus()->epGetVars()));
$perf->setSchedule(new Schedule($activity->getSchedule()->epGetVars()));
if ($activity->getVenue()) {
$perf->setVenue(new Venue($activity->getVenue()->epGetVars()));
}
$activities[] = $perf;
}
$bean->setChildren($activities);
}
return $bean;
}