本文整理汇总了PHP中Opportunity::getTableName方法的典型用法代码示例。如果您正苦于以下问题:PHP Opportunity::getTableName方法的具体用法?PHP Opportunity::getTableName怎么用?PHP Opportunity::getTableName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Opportunity
的用法示例。
在下文中一共展示了Opportunity::getTableName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
$super = SecurityTestHelper::createSuperAdmin();
Yii::app()->user->userModel = $super;
$accountTableName = Account::getTableName();
$contactTableName = Contact::getTableName();
$opportunityTableName = Opportunity::getTableName();
ExternalSystemIdUtil::addExternalIdColumnIfMissing($accountTableName);
ExternalSystemIdUtil::addExternalIdColumnIfMissing($contactTableName);
ExternalSystemIdUtil::addExternalIdColumnIfMissing($opportunityTableName);
}
示例2: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
$super = SecurityTestHelper::createSuperAdmin();
Yii::app()->user->userModel = $super;
$accountTableName = Account::getTableName('Account');
$contactTableName = Contact::getTableName('Contact');
$opportunityTableName = Opportunity::getTableName('Opportunity');
$columnName = ExternalSystemIdUtil::EXTERNAL_SYSTEM_ID_COLUMN_NAME;
RedBeanColumnTypeOptimizer::externalIdColumn($accountTableName, $columnName);
RedBeanColumnTypeOptimizer::externalIdColumn($contactTableName, $columnName);
RedBeanColumnTypeOptimizer::externalIdColumn($opportunityTableName, $columnName);
}
示例3: testImportDataAnalysisResults
public function testImportDataAnalysisResults()
{
$super = User::getByUsername('super');
Yii::app()->user->userModel = $super;
$import = new Import();
$serializedData['importRulesType'] = 'Tasks';
$import->serializedData = serialize($serializedData);
$this->assertTrue($import->save());
$accountTableName = Account::getTableName('Account');
$contactTableName = Contact::getTableName('Contact');
$opportunityTableName = Opportunity::getTableName('Opportunity');
$account1 = AccountTestHelper::createAccountByNameForOwner('account1', $super);
$account2 = AccountTestHelper::createAccountByNameForOwner('account2', $super);
$account3 = AccountTestHelper::createAccountByNameForOwner('account3', $super);
$contact1 = ContactTestHelper::createContactByNameForOwner('contact1', $super);
$contact2 = ContactTestHelper::createContactByNameForOwner('contact2', $super);
$contact3 = ContactTestHelper::createContactByNameForOwner('contact3', $super);
$opportunity1 = OpportunityTestHelper::createOpportunityByNameForOwner('opportunity1', $super);
$opportunity2 = OpportunityTestHelper::createOpportunityByNameForOwner('opportunity2', $super);
$opportunity3 = OpportunityTestHelper::createOpportunityByNameForOwner('opportunity3', $super);
//Make models externally linked for testing.
ImportTestHelper::updateModelsExternalId($account2, 'ACC');
ImportTestHelper::updateModelsExternalId($contact2, 'CON');
ImportTestHelper::updateModelsExternalId($opportunity2, 'OPP');
ImportTestHelper::createTempTableByFileNameAndTableName('importAnalyzerTest.csv', $import->getTempTableName(), Yii::getPathOfAlias('application.modules.tasks.tests.unit.files'));
R::exec("update " . $import->getTempTableName() . " set column_0 = " . $account3->id . " where id != 1 limit 3");
R::exec("update " . $import->getTempTableName() . " set column_2 = " . $contact3->id . " where id != 1 limit 4");
R::exec("update " . $import->getTempTableName() . " set column_4 = " . $opportunity3->id . " where id != 1 limit 5");
$mappingData = array('column_0' => ImportMappingUtil::makeModelDerivedColumnMappingData('AccountDerived', IdValueTypeMappingRuleForm::ZURMO_MODEL_ID), 'column_1' => ImportMappingUtil::makeModelDerivedColumnMappingData('AccountDerived'), 'column_2' => ImportMappingUtil::makeModelDerivedColumnMappingData('ContactDerived', IdValueTypeMappingRuleForm::ZURMO_MODEL_ID), 'column_3' => ImportMappingUtil::makeModelDerivedColumnMappingData('ContactDerived'), 'column_4' => ImportMappingUtil::makeModelDerivedColumnMappingData('OpportunityDerived', IdValueTypeMappingRuleForm::ZURMO_MODEL_ID), 'column_5' => ImportMappingUtil::makeModelDerivedColumnMappingData('OpportunityDerived'));
$serializedData = unserialize($import->serializedData);
$serializedData['mappingData'] = $mappingData;
$import->serializedData = serialize($serializedData);
$this->assertTrue($import->save());
$importRules = ImportRulesUtil::makeImportRulesByType('Tasks');
$config = array('pagination' => array('pageSize' => 2));
//This test csv has a header row.
$dataProvider = new ImportDataProvider($import->getTempTableName(), true, $config);
//Run data analyzer
$importDataAnalyzer = new ImportDataAnalyzer($importRules, $dataProvider);
foreach ($mappingData as $columnName => $columnMappingData) {
$importDataAnalyzer->analyzeByColumnNameAndColumnMappingData($columnName, $columnMappingData);
}
$messagesData = $importDataAnalyzer->getMessagesData();
$compareData = array('column_0' => array(array('message' => '3 record(s) will be updated and 7 record(s) will be skipped during import.', 'sanitizerUtilType' => 'AccountDerivedIdValueType', 'moreAvailable' => false)), 'column_1' => array(array('message' => '3 record(s) will be updated and 7 record(s) will be skipped during import.', 'sanitizerUtilType' => 'AccountDerivedIdValueType', 'moreAvailable' => false)), 'column_2' => array(array('message' => '4 record(s) will be updated and 6 record(s) will be skipped during import.', 'sanitizerUtilType' => 'ContactDerivedIdValueType', 'moreAvailable' => false)), 'column_3' => array(array('message' => '3 record(s) will be updated and 7 record(s) will be skipped during import.', 'sanitizerUtilType' => 'ContactDerivedIdValueType', 'moreAvailable' => false)), 'column_4' => array(array('message' => '5 record(s) will be updated and 5 record(s) will be skipped during import.', 'sanitizerUtilType' => 'OpportunityDerivedIdValueType', 'moreAvailable' => false)), 'column_5' => array(array('message' => '3 record(s) will be updated and 7 record(s) will be skipped during import.', 'sanitizerUtilType' => 'OpportunityDerivedIdValueType', 'moreAvailable' => false)));
$this->assertEquals($compareData, $messagesData);
$importInstructionsData = $importDataAnalyzer->getImportInstructionsData();
$compareInstructionsData = array();
$this->assertEquals($compareInstructionsData, $importInstructionsData);
}
示例4: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
$super = SecurityTestHelper::createSuperAdmin();
Yii::app()->user->userModel = $super;
ExternalSystemIdUtil::addExternalIdColumnIfMissing(Account::getTableName());
ExternalSystemIdUtil::addExternalIdColumnIfMissing(Contact::getTableName());
ExternalSystemIdUtil::addExternalIdColumnIfMissing(Opportunity::getTableName());
$account = AccountTestHelper::createAccountByNameForOwner('testAccount', $super);
ImportTestHelper::updateModelsExternalId($account, 'ACC');
$contact = ContactTestHelper::createContactByNameForOwner('testContact', $super);
ImportTestHelper::updateModelsExternalId($contact, 'CON');
$opportunity = OpportunityTestHelper::createOpportunityByNameForOwner('testOpportunity', $super);
ImportTestHelper::updateModelsExternalId($opportunity, 'OPP');
}