当前位置: 首页>>代码示例>>PHP>>正文


PHP Department::getDefaultPerson方法代码示例

本文整理汇总了PHP中Department::getDefaultPerson方法的典型用法代码示例。如果您正苦于以下问题:PHP Department::getDefaultPerson方法的具体用法?PHP Department::getDefaultPerson怎么用?PHP Department::getDefaultPerson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Department的用法示例。


在下文中一共展示了Department::getDefaultPerson方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Department

    }
    $c->save();
    echo "Category: {$c->getName()}\n";
}
// Now that we've got People and Categories in the database,
// Link the Departments with their Categories and Default Person
$result = $mongo->departments->find();
foreach ($result as $r) {
    $d = new Department($r['name']);
    if (!empty($r['defaultPerson']['_id'])) {
        $id = getPersonIdFromCrosswalk($r['defaultPerson']['_id']);
        $d->setDefaultPerson_id($id);
    }
    if (!empty($r['categories'])) {
        $ids = array();
        foreach ($r['categories'] as $c) {
            try {
                $category = new Category($c['name']);
                $ids[] = $category->getId();
            } catch (Exception $e) {
                // Departments may have old categories we have deleted
                // Just ignore them
            }
        }
        $d->setCategories($ids);
    }
    $d->save();
    $p = $d->getDefaultPerson();
    $p = $p ? $p->getFullname() : '';
    echo "Department: {$d->getName()} Person: {$p}\n";
}
开发者ID:CodeForEindhoven,项目名称:uReport,代码行数:31,代码来源:2_DepartmentsPeopleCategories.php

示例2: list

     }
 }
 if (!$ticket->getEnteredByPerson()) {
     $ticket->setEnteredByPerson('unknown');
 }
 if (isset($row['assigned_to']) && $row['assigned_to']) {
     try {
         list($username, $fullname) = explode(':', $row['assigned_to']);
         $person = new Person($username);
         $ticket->setAssignedPerson($person);
     } catch (Exception $e) {
     }
 } elseif (isset($row['dept'])) {
     try {
         $department = new Department($row['dept']);
         $ticket->setAssignedPerson($department->getDefaultPerson());
     } catch (Exception $e) {
     }
 }
 // Check the location against Master Address
 // Master Address data should overwrite information from ReqPro
 $row['street_num'] = preg_replace('/[^a-zA-Z0-9\\-\\&\\s\'\\/]/', '', $row['street_num']);
 if ($row['street_num']) {
     $query = preg_match('/[a-zA-Z]/', $row['street_num']) ? $row['street_num'] : "{$row['street_num']} {$row['street_dir']} {$row['street_name']} {$row['street_type']} {$row['sud_type']} {$row['sud_num']}";
     $data = AddressService::getLocationData($query);
     echo $query . ' ==> ';
     if (count($data)) {
         $ticket->setAddressServiceData($data);
     } else {
         if (is_numeric($row['street_num'])) {
             $location = "{$row['street_num']} {$row['street_dir']} {$row['street_name']} {$row['street_type']} {$row['sud_type']} {$row['sud_num']}";
开发者ID:CodeForEindhoven,项目名称:uReport,代码行数:31,代码来源:6_tickets.php


注:本文中的Department::getDefaultPerson方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。