コード例 #1
0
$methods = $result['items'];
foreach ($methods as $m) {
    $o = new ContactMethod();
    $o->setName($m);
    $o->save();
    echo "ContactMethod: {$o->getName()}\n";
}
$result = $mongo->lookups->findOne(array('name' => 'types'));
$types = $result['items'];
foreach ($types as $t) {
    $o = new IssueType();
    $o->setName($t);
    $o->save();
    echo "IssueType: {$o->getName()}\n";
}
$result = $mongo->lookups->findOne(array('name' => 'labels'));
$labels = $result['items'];
foreach ($labels as $l) {
    $o = new Label();
    $o->setName($l);
    $o->save();
    echo "Label: {$o->getName()}\n";
}
$result = $mongo->categoryGroups->find();
foreach ($result as $r) {
    $o = new CategoryGroup();
    $o->setName($r['name']);
    $o->setOrdering($r['order']);
    $o->save();
    echo "CategoryGroup: {$o->getName()}\n";
}