本文整理匯總了PHP中Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder::addIdColumns方法的典型用法代碼示例。如果您正苦於以下問題:PHP ClassMetadataBuilder::addIdColumns方法的具體用法?PHP ClassMetadataBuilder::addIdColumns怎麽用?PHP ClassMetadataBuilder::addIdColumns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder
的用法示例。
在下文中一共展示了ClassMetadataBuilder::addIdColumns方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('categories')->setCustomRepositoryClass('Mautic\\CategoryBundle\\Entity\\CategoryRepository')->addIndex(['alias'], 'category_alias_search');
$builder->addIdColumns('title');
$builder->addField('alias', 'string');
$builder->createField('color', 'string')->nullable()->length(7)->build();
$builder->createField('bundle', 'string')->length(50)->build();
}
示例2: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('stages')->setCustomRepositoryClass('Mautic\\StageBundle\\Entity\\StageRepository');
$builder->addIdColumns();
$builder->createField('weight', 'integer')->build();
$builder->addPublishDates();
$builder->createOneToMany('log', 'LeadStageLog')->mappedBy('stage')->cascadePersist()->cascadeRemove()->fetchExtraLazy()->build();
$builder->addCategory();
}
示例3: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('roles')->setCustomRepositoryClass('Mautic\\UserBundle\\Entity\\RoleRepository');
$builder->addIdColumns();
$builder->createField('isAdmin', 'boolean')->columnName('is_admin')->build();
$builder->createOneToMany('permissions', 'Permission')->orphanRemoval()->mappedBy('role')->cascadePersist()->cascadeRemove()->fetchExtraLazy()->build();
$builder->createField('rawPermissions', 'array')->columnName('readable_permissions')->build();
$builder->createOneToMany('users', 'User')->mappedBy('role')->fetchExtraLazy()->build();
}
示例4: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('lead_lists')->setCustomRepositoryClass('Mautic\\LeadBundle\\Entity\\LeadListRepository');
$builder->addIdColumns();
$builder->addField('alias', 'string');
$builder->addField('filters', 'array');
$builder->createField('isGlobal', 'boolean')->columnName('is_global')->build();
$builder->createOneToMany('leads', 'ListLead')->setIndexBy('id')->mappedBy('list')->fetchExtraLazy()->build();
}
示例5: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('dynamic_content_lead_data');
$builder->addIdColumns(false, false);
$builder->addDateAdded(true);
$builder->createManyToOne('lead', 'Mautic\\LeadBundle\\Entity\\Lead')->inversedBy('id')->addJoinColumn('lead_id', 'id')->build();
$builder->createManyToOne('dynamicContent', 'DynamicContent')->inversedBy('id')->addJoinColumn('dynamic_content_id', 'id')->build();
$builder->createField('slot', 'text')->columnName('slot')->build();
}
示例6: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('form_actions')->setCustomRepositoryClass('Mautic\\FormBundle\\Entity\\ActionRepository')->addIndex(array('type'), 'form_action_type_search');
$builder->addIdColumns();
$builder->createField('type', 'string')->length(50)->build();
$builder->createField('order', 'integer')->columnName('action_order')->build();
$builder->addField('properties', 'array');
$builder->createManyToOne('form', 'Form')->inversedBy('actions')->addJoinColumn('form_id', 'id', false, false, 'CASCADE')->build();
}
示例7: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('oauth1_consumers')->setCustomRepositoryClass('Mautic\\ApiBundle\\Entity\\oAuth1\\ConsumerRepository')->addLifecycleEvent('createConsumerKeys', 'prePersist')->addIndex(array('consumer_key'), 'consumer_search');
$builder->addIdColumns('name', false);
$builder->createField('consumerKey', 'string')->columnName('consumer_key')->build();
$builder->createField('consumerSecret', 'string')->columnName('consumer_secret')->build();
$builder->addField('callback', 'string');
$builder->createOneToMany('accessTokens', 'AccessToken')->setIndexBy('id')->mappedBy('consumer')->fetchExtraLazy()->build();
}
示例8: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('oauth2_clients')->setCustomRepositoryClass('Mautic\\ApiBundle\\Entity\\oAuth2\\ClientRepository')->addIndex(array('random_id'), 'client_id_search');
$builder->addIdColumns('name', false);
$builder->createManyToMany('users', 'Mautic\\UserBundle\\Entity\\User')->setJoinTable('oauth2_user_client_xref')->addInverseJoinColumn('user_id', 'id', false, false, 'CASCADE')->addJoinColumn('client_id', 'id', false, false, 'CASCADE')->fetchExtraLazy()->build();
$builder->createField('randomId', 'string')->columnName('random_id')->build();
$builder->addField('secret', 'string');
$builder->createField('redirectUris', 'array')->columnName('redirect_uris')->build();
$builder->createField('allowedGrantTypes', 'array')->columnName('allowed_grant_types')->build();
}
示例9: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('plugins')->setCustomRepositoryClass('Mautic\\PluginBundle\\Entity\\PluginRepository')->addUniqueConstraint(['bundle'], 'unique_bundle');
$builder->addIdColumns();
$builder->createField('isMissing', 'boolean')->columnName('is_missing')->build();
$builder->createField('bundle', 'string')->length(50)->build();
$builder->createField('version', 'string')->nullable()->build();
$builder->createField('author', 'string')->nullable()->build();
$builder->createOneToMany('integrations', 'Integration')->setIndexBy('id')->mappedBy('plugin')->fetchExtraLazy()->build();
}
示例10: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('point_trigger_events')->setCustomRepositoryClass('Mautic\\PointBundle\\Entity\\TriggerEventRepository')->addIndex(['type'], 'trigger_type_search');
$builder->addIdColumns();
$builder->createField('type', 'string')->length(50)->build();
$builder->createField('order', 'integer')->columnName('action_order')->build();
$builder->addField('properties', 'array');
$builder->createManyToOne('trigger', 'Trigger')->inversedBy('events')->addJoinColumn('trigger_id', 'id', false, false, 'CASCADE')->build();
$builder->createOneToMany('log', 'LeadTriggerLog')->mappedBy('event')->cascadePersist()->cascadeRemove()->fetchExtraLazy()->build();
}
示例11: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('points')->setCustomRepositoryClass('Mautic\\PointBundle\\Entity\\PointRepository')->addIndex(array('type'), 'point_type_search');
$builder->addIdColumns();
$builder->createField('type', 'string')->length(50)->build();
$builder->addPublishDates();
$builder->addField('delta', 'integer');
$builder->addField('properties', 'array');
$builder->createOneToMany('log', 'LeadPointLog')->mappedBy('point')->cascadePersist()->cascadeRemove()->fetchExtraLazy()->build();
$builder->addCategory();
}
示例12: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('point_triggers')->setCustomRepositoryClass('Mautic\\PointBundle\\Entity\\TriggerRepository');
$builder->addIdColumns();
$builder->addPublishDates();
$builder->addField('points', 'integer');
$builder->createField('color', 'string')->length(7)->build();
$builder->createField('triggerExistingLeads', 'boolean')->columnName('trigger_existing_leads')->build();
$builder->addCategory();
$builder->createOneToMany('events', 'TriggerEvent')->setIndexBy('id')->setOrderBy(array('order' => 'ASC'))->mappedBy('trigger')->cascadeAll()->fetchExtraLazy()->build();
}
示例13: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('reports')->setCustomRepositoryClass('Mautic\\ReportBundle\\Entity\\ReportRepository');
$builder->addIdColumns();
$builder->addField('system', 'boolean');
$builder->addField('source', 'string');
$builder->createField('columns', 'array')->nullable()->build();
$builder->createField('filters', 'array')->nullable()->build();
$builder->createField('tableOrder', 'array')->columnName('table_order')->nullable()->build();
$builder->createField('graphs', 'array')->nullable()->build();
}
示例14: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('monitoring')->setCustomRepositoryClass('MauticPlugin\\MauticSocialBundle\\Entity\\MonitoringRepository')->addLifecycleEvent('cleanMonitorData', 'preUpdate')->addLifecycleEvent('cleanMonitorData', 'prePersist');
$builder->addCategory();
$builder->addIdColumns('title');
$builder->addNullableField('lists', 'array');
$builder->addNamedField('networkType', 'string', 'network_type', true);
$builder->addField('revision', 'integer');
$builder->addNullableField('stats', 'array');
$builder->addNullableField('properties', 'array');
$builder->addPublishDates();
}
示例15: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('webhooks')->setCustomRepositoryClass('Mautic\\WebhookBundle\\Entity\\WebhookRepository');
// id columns
$builder->addIdColumns();
// categories
$builder->addCategory();
// 1:M for events
$builder->createOneToMany('events', 'Event')->orphanRemoval()->setIndexBy('event_type')->mappedBy('webhook')->cascadePersist()->build();
// 1:M for queues
$builder->createOneToMany('queues', 'WebhookQueue')->mappedBy('webhook')->fetchExtraLazy()->cascadePersist()->build();
// 1:M for logs
$builder->createOneToMany('logs', 'Log')->setOrderBy(['dateAdded' => 'DESC'])->fetchExtraLazy()->mappedBy('webhook')->cascadePersist()->build();
// status code
$builder->createField('webhookUrl', 'string')->columnName('webhook_url')->length(255)->build();
}