本文整理汇总了PHP中DAO_Worker::clearCache方法的典型用法代码示例。如果您正苦于以下问题:PHP DAO_Worker::clearCache方法的具体用法?PHP DAO_Worker::clearCache怎么用?PHP DAO_Worker::clearCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAO_Worker
的用法示例。
在下文中一共展示了DAO_Worker::clearCache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _handleImportWorker
private function _handleImportWorker($xml)
{
$settings = CerberusSettings::getInstance();
$logger = DevblocksPlatform::getConsoleLog();
$sFirstName = (string) $xml->first_name;
$sLastName = (string) $xml->last_name;
$sEmail = (string) $xml->email;
$sPassword = (string) $xml->password;
$isSuperuser = (int) $xml->is_superuser;
// Dupe check worker email
if (null != ($worker_id = DAO_Worker::lookupAgentEmail($sEmail))) {
$logger->info('[Importer] Avoiding creating duplicate worker #' . $worker_id . ' (' . $sEmail . ')');
return true;
}
$worker_id = DAO_Worker::create($sEmail, CerberusApplication::generatePassword(8), $sFirstName, $sLastName, '');
DAO_Worker::updateAgent($worker_id, array(DAO_Worker::PASSWORD => $sPassword, DAO_Worker::IS_SUPERUSER => intval($isSuperuser)));
// Address to Worker
DAO_AddressToWorker::assign($sEmail, $worker_id);
DAO_AddressToWorker::update($sEmail, array(DAO_AddressToWorker::IS_CONFIRMED => 1));
$logger->info('[Importer] Imported worker #' . $worker_id . ' (' . $sEmail . ')');
DAO_Worker::clearCache();
return true;
}