本文整理汇总了PHP中Oro\Bundle\MigrationBundle\Migration\QueryBag::addQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP QueryBag::addQuery方法的具体用法?PHP QueryBag::addQuery怎么用?PHP QueryBag::addQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\MigrationBundle\Migration\QueryBag
的用法示例。
在下文中一共展示了QueryBag::addQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$queries->addQuery(new UpdateEntityConfigEntityValueQuery('Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowDefinition', 'entity', 'label', 'oro.workflow.workflowdefinition.entity_label'));
$queries->addQuery(new UpdateEntityConfigEntityValueQuery('Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowDefinition', 'entity', 'plural_label', 'oro.workflow.workflowdefinition.entity_plural_label'));
$queries->addQuery(new UpdateEntityConfigEntityValueQuery('Oro\\Bundle\\WorkflowBundle\\Entity\\ProcessDefinition', 'entity', 'label', 'oro.workflow.processdefinition.entity_label'));
$queries->addQuery(new UpdateEntityConfigEntityValueQuery('Oro\\Bundle\\WorkflowBundle\\Entity\\ProcessDefinition', 'entity', 'plural_label', 'oro.workflow.processdefinition.entity_label'));
}
示例2: down
public function down(Schema $schema, QueryBag $queries)
{
$queries->addQuery("DROP TABLE c_notebook");
$queries->addQuery("DROP TABLE c_notebook_audit");
/*$this->addSql('CREATE TABLE oro_migrations (id INT AUTO_INCREMENT NOT NULL, bundle VARCHAR(250) NOT NULL, version VARCHAR(250) NOT NULL, loaded_at DATETIME NOT NULL, INDEX idx_oro_migrations (bundle), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE oro_migrations_data (id INT AUTO_INCREMENT NOT NULL, class_name VARCHAR(255) NOT NULL, loaded_at DATETIME NOT NULL, version VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE sylius_settings_parameter (id INT AUTO_INCREMENT NOT NULL, namespace VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, value LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:object)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('DROP TABLE c_item_visibility');
$this->addSql('DROP TABLE c_item');
$this->addSql('ALTER TABLE c_item_property DROP PRIMARY KEY');
$this->addSql('ALTER TABLE c_item_property ADD iid INT AUTO_INCREMENT NOT NULL, ADD tool VARCHAR(100) NOT NULL, ADD visibility TINYINT(1) NOT NULL, ADD start_visible DATETIME DEFAULT NULL, ADD end_visible DATETIME DEFAULT NULL, CHANGE id id INT NOT NULL, CHANGE item_id ref INT NOT NULL');
$this->addSql('CREATE INDEX idx_item_property_toolref ON c_item_property (tool, ref)');
$this->addSql('CREATE INDEX idx_item_property_tooliuid ON c_item_property (tool, insert_user_id)');
$this->addSql('ALTER TABLE c_item_property ADD PRIMARY KEY (iid)');
$this->addSql('ALTER TABLE c_notebook DROP FOREIGN KEY FK_E7EE1CE0A76ED395');
$this->addSql('ALTER TABLE c_notebook DROP FOREIGN KEY FK_E7EE1CE091D79BD3');
$this->addSql('DROP INDEX IDX_E7EE1CE0A76ED395 ON c_notebook');
$this->addSql('DROP INDEX IDX_E7EE1CE091D79BD3 ON c_notebook');
$this->addSql('ALTER TABLE c_notebook DROP PRIMARY KEY');
$this->addSql('ALTER TABLE c_notebook ADD notebook_id INT NOT NULL, ADD course VARCHAR(40) NOT NULL, CHANGE id iid INT AUTO_INCREMENT NOT NULL');
$this->addSql('ALTER TABLE c_notebook ADD PRIMARY KEY (iid)');
$this->addSql('ALTER TABLE c_notebook_audit DROP PRIMARY KEY');
$this->addSql('ALTER TABLE c_notebook_audit ADD notebook_id INT DEFAULT NULL, ADD course VARCHAR(40) DEFAULT NULL, CHANGE id iid INT NOT NULL');
$this->addSql('ALTER TABLE c_notebook_audit ADD PRIMARY KEY (iid, rev)');
$this->addSql('ALTER TABLE media__media CHANGE content_type content_type VARCHAR(64) DEFAULT NULL');
$this->addSql('ALTER TABLE media__media_audit CHANGE content_type content_type VARCHAR(64) DEFAULT NULL');
$this->addSql('ALTER TABLE settings_current ADD namespace VARCHAR(255) NOT NULL, ADD name VARCHAR(255) NOT NULL');*/
}
示例3: up
/**
* @inheritdoc
*/
public function up(Schema $schema, QueryBag $queries)
{
if ($schema instanceof ExtendSchema) {
$queries->addQuery(new UpdateExtendConfigMigrationQuery($schema->getExtendOptions(), $this->commandExecutor, $this->configProcessorOptionsPath));
$queries->addQuery(new RefreshExtendCacheMigrationQuery($this->commandExecutor));
}
}
示例4: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
foreach ($this->getFieldsParamsForUpdate() as $field) {
$queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
$queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
}
}
示例5: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
if ($schema->hasTable('oro_process_definition')) {
$queries->addQuery(new ParametrizedSqlMigrationQuery('DELETE FROM oro_process_definition WHERE name = :name', ['name' => 'email_auto_response']));
$queries->addQuery(new ParametrizedSqlMigrationQuery('DELETE FROM oro_process_trigger WHERE definition_name = :name', ['name' => 'email_auto_response']));
}
}
示例6: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$fields = [['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\Lead', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'orocrm.sales.lead.created_at.label'], ['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\Lead', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'orocrm.sales.lead.updated_at.label'], ['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\Opportunity', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'orocrm.sales.opportunity.created_at.label'], ['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\Opportunity', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'orocrm.sales.opportunity.updated_at.label'], ['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\SalesFunnel', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'orocrm.sales.salesfunnel.created_at.label'], ['entityName' => 'OroCRM\\Bundle\\SalesBundle\\Entity\\SalesFunnel', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'orocrm.sales.salesfunnel.updated_at.label']];
foreach ($fields as $field) {
$queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
$queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
}
}
示例7: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$fields = [['entityName' => 'Oro\\Bundle\\EmbeddedFormBundle\\Entity\\EmbeddedForm', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'oro.embeddedform.created_at.label'], ['entityName' => 'Oro\\Bundle\\EmbeddedFormBundle\\Entity\\EmbeddedForm', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'oro.embeddedform.updated_at.label']];
foreach ($fields as $field) {
$queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
$queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
}
}
示例8: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$fields = [['entityName' => 'OroCRM\\Bundle\\ContactBundle\\Entity\\Contact', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'orocrm.contact.created_at.label'], ['entityName' => 'OroCRM\\Bundle\\ContactBundle\\Entity\\Contact', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'orocrm.contact.updated_at.label'], ['entityName' => 'OroCRM\\Bundle\\ContactBundle\\Entity\\ContactAddress', 'field' => 'created', 'value' => 'oro.ui.created_at', 'replace' => 'orocrm.contact.contactaddress.created.label'], ['entityName' => 'OroCRM\\Bundle\\ContactBundle\\Entity\\ContactAddress', 'field' => 'updated', 'value' => 'oro.ui.updated_at', 'replace' => 'orocrm.contact.contactaddress.updated.label']];
foreach ($fields as $field) {
$queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
$queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
}
}
示例9: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$this->configManager->flushAllCaches();
if ($schema instanceof ExtendSchema) {
$queries->addQuery(new RefreshExtendConfigMigrationQuery($this->commandExecutor, $this->dataStorageExtension->get('initial_entity_config_state', []), $this->initialEntityConfigStatePath));
$queries->addQuery(new RefreshExtendCacheMigrationQuery($this->commandExecutor));
}
}
示例10: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
self::addOrganization($schema);
//Add organization fields to ownership entity config
$queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\ContactBundle\\Entity\\Contact', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
//Add organization fields to ownership entity config
$queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\ContactBundle\\Entity\\Group', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
}
示例11: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
if ($schema instanceof ExtendSchema) {
$queries->addQuery(new UpdateExtendConfigMigrationQuery($schema->getExtendOptions(), $this->commandExecutor, $this->configProcessorOptionsPath));
$queries->addQuery(new RefreshExtendConfigMigrationQuery($this->commandExecutor, $this->dataStorageExtension->get('initial_entity_config_state', []), $this->initialEntityConfigStatePath));
$queries->addQuery(new RefreshExtendCacheMigrationQuery($this->commandExecutor));
}
}
示例12: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
self::addOrganization($schema, 'orocrm_campaign');
self::addOrganization($schema, 'orocrm_campaign_email');
//Add organization fields to ownership entity config
$queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\CampaignBundle\\Entity\\Campaign', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
$queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\CampaignBundle\\Entity\\EmailCampaign', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
}
示例13: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
$queries->addQuery(new DropUnusedEntityConfigFieldValuesQuery());
$fields = [['entityName' => 'Oro\\Bundle\\OrganizationBundle\\Entity\\BusinessUnit', 'field' => 'createdAt', 'value' => 'oro.ui.created_at', 'replace' => 'oro.organization.businessunit.created_at.label'], ['entityName' => 'Oro\\Bundle\\OrganizationBundle\\Entity\\BusinessUnit', 'field' => 'updatedAt', 'value' => 'oro.ui.updated_at', 'replace' => 'oro.organization.businessunit.updated_at.label']];
foreach ($fields as $field) {
$queries->addQuery(new UpdateEntityConfigFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
$queries->addQuery(new UpdateEntityConfigIndexFieldValueQuery($field['entityName'], $field['field'], 'entity', 'label', $field['value'], $field['replace']));
}
}
示例14: up
/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
self::addOrganization($schema);
//Add organization fields to ownership entity config
$queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\SalesBundle\\Entity\\Lead', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
//Add organization fields to ownership entity config
$queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\SalesBundle\\Entity\\Opportunity', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
//Add organization fields to ownership entity config
$queries->addQuery(new UpdateOwnershipTypeQuery('OroCRM\\Bundle\\SalesBundle\\Entity\\B2bCustomer', ['organization_field_name' => 'organization', 'organization_column_name' => 'organization_id']));
}
示例15: updateMailboxName
/**
* @param Schema $schema
* @param QueryBag $queries
*/
public static function updateMailboxName(Schema $schema, QueryBag $queries)
{
$table = $schema->getTable('oro_email_origin');
$sql = 'UPDATE oro_email_origin SET mailbox_name = %s WHERE name = :name';
$queries->addQuery(new ParametrizedSqlMigrationQuery(sprintf($sql, "'" . InternalEmailOrigin::MAILBOX_NAME . "'"), ['name' => 'internalemailorigin'], ['name' => Type::STRING]));
if ($table->hasColumn('imap_user')) {
$queries->addQuery(new ParametrizedSqlMigrationQuery(sprintf($sql, 'imap_user'), ['name' => 'imapemailorigin'], ['name' => Type::STRING]));
$queries->addQuery(new ParametrizedSqlMigrationQuery(sprintf($sql, 'imap_user'), ['name' => 'useremailorigin'], ['name' => Type::STRING]));
}
if ($table->hasColumn('ews_user_email')) {
$queries->addQuery(new ParametrizedSqlMigrationQuery(sprintf($sql, 'ews_user_email'), ['name' => 'ewsemailorigin'], ['name' => Type::STRING]));
}
}