本文整理汇总了PHP中Import::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Import::getAll方法的具体用法?PHP Import::getAll怎么用?PHP Import::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Import
的用法示例。
在下文中一共展示了Import::getAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRun
public function testRun()
{
$quote = DatabaseCompatibilityUtil::getQuote();
//Create 2 imports, and set one with a date over a week ago (8 days ago) for the modifiedDateTime
$import = new Import();
$serializedData['importRulesType'] = 'ImportModelTestItem';
$import->serializedData = serialize($serializedData);
$this->assertTrue($import->save());
ImportTestHelper::createTempTableByFileNameAndTableName('importAnalyzerTest.csv', $import->getTempTableName(), true);
$modifiedDateTime = DateTimeUtil::convertTimestampToDbFormatDateTime(time() - 60 * 60 * 24 * 8);
$sql = "Update item set modifieddatetime = '" . $modifiedDateTime . "' where id = " . $import->getClassId('Item');
ZurmoRedBean::exec($sql);
$staleImportId = $import->id;
$import2 = new Import();
$serializedData['importRulesType'] = 'ImportModelTestItem';
$import2->serializedData = serialize($serializedData);
$this->assertTrue($import2->save());
ImportTestHelper::createTempTableByFileNameAndTableName('importAnalyzerTest.csv', $import2->getTempTableName(), true);
$this->assertEquals(2, Import::getCount());
$tableExists = ZurmoRedBean::$writer->doesTableExist($import->getTempTableName());
$this->assertTrue($tableExists);
$job = new ImportCleanupJob();
$this->assertTrue($job->run());
$tableExists = ZurmoRedBean::$writer->doesTableExist($import->getTempTableName());
$this->assertFalse($tableExists);
$imports = Import::getAll();
$this->assertEquals(1, count($imports));
$this->assertEquals($import2->id, $imports[0]->id);
}
示例2: import
private function import()
{
$import = new Import($this->_siteID);
$data = $import->getAll();
$attachments = new Attachments($this->_siteID);
$bulk = $attachments->getBulkAttachmentsInfo();
if (count($data) > 0) {
$this->_template->assign('pendingCommits', true);
}
if (!eval(Hooks::get('IMPORT2_SHOW'))) {
return;
}
$this->_template->assign('active', $this);
$this->_template->assign('bulk', $bulk);
$this->_template->display('./modules/import/Import1.tpl');
}