當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ClassMetadataBuilder::addIdColumns方法代碼示例

本文整理匯總了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();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:12,代碼來源:Category.php

示例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();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:13,代碼來源:Stage.php

示例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();
 }
開發者ID:spdaly,項目名稱:mautic,代碼行數:13,代碼來源:Role.php

示例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();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:13,代碼來源:LeadList.php

示例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();
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:13,代碼來源:DynamicContentLeadData.php

示例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();
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:13,代碼來源:Action.php

示例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();
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:13,代碼來源:Consumer.php

示例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();
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:14,代碼來源:Client.php

示例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();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:14,代碼來源:Plugin.php

示例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();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:14,代碼來源:TriggerEvent.php

示例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();
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:15,代碼來源:Point.php

示例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();
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:15,代碼來源:Trigger.php

示例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();
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:15,代碼來源:Report.php

示例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();
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:16,代碼來源:Monitoring.php

示例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();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:20,代碼來源:Webhook.php


注:本文中的Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder::addIdColumns方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。