本文整理汇总了PHP中Oro\Bundle\EntityConfigBundle\Config\ConfigManager::clearModelCache方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigManager::clearModelCache方法的具体用法?PHP ConfigManager::clearModelCache怎么用?PHP ConfigManager::clearModelCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\EntityConfigBundle\Config\ConfigManager
的用法示例。
在下文中一共展示了ConfigManager::clearModelCache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runActivityLists
/**
* @param LoggerInterface $logger
* @param bool $dryRun
*/
protected function runActivityLists(LoggerInterface $logger, $dryRun = false)
{
$this->configManager->clearModelCache();
$targetEntities = $this->provider->getTargetEntityClasses();
$toSchema = clone $this->schema;
$hasSchemaChanges = false;
foreach ($targetEntities as $targetEntity) {
$associationName = ExtendHelper::buildAssociationName($targetEntity, ActivityListEntityConfigDumperExtension::ASSOCIATION_KIND);
$relationTableName = $this->nameGenerator->generateManyToManyJoinTableName(ActivityListEntityConfigDumperExtension::ENTITY_CLASS, $associationName, $targetEntity);
if (!$toSchema->hasTable($relationTableName)) {
$hasSchemaChanges = true;
$this->activityListExtension->addActivityListAssociation($toSchema, $this->metadataHelper->getTableNameByEntityClass($targetEntity));
}
}
if ($hasSchemaChanges) {
$comparator = new Comparator();
$platform = $this->connection->getDatabasePlatform();
$schemaDiff = $comparator->compare($this->schema, $toSchema);
$queries = $schemaDiff->toSql($platform);
foreach ($queries as $query) {
$this->logQuery($logger, $query);
if (!$dryRun) {
$this->connection->executeQuery($query);
}
}
}
}