Beispiel #1
0
<?php

/**
 * @copyright 2012 City of Bloomington, Indiana
 * @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
 * @author Cliff Ingham <*****@*****.**>
 */
require_once './config.inc';
// Clear out the lookup tables.  We'll import everything from Mongo
// The mysql.sql script preloads some generic values for these tables
$zend_db->delete('resolutions');
$zend_db->delete('actions');
$result = $mongo->resolutions->find();
foreach ($result as $r) {
    $o = new Resolution();
    $o->handleUpdate($r);
    $o->save();
    echo "Resolution: {$o->getName()}\n";
}
$result = $mongo->actions->find();
foreach ($result as $r) {
    $o = new Action();
    $o->handleUpdate($r);
    $o->save();
    echo "Action: {$o->getName()}\n";
}
$result = $mongo->lookups->findOne(array('name' => 'contactMethods'));
$methods = $result['items'];
foreach ($methods as $m) {
    $o = new ContactMethod();
    $o->setName($m);