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


PHP ClassMetadataBuilder::createManyToOne方法代碼示例

本文整理匯總了PHP中Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder::createManyToOne方法的典型用法代碼示例。如果您正苦於以下問題:PHP ClassMetadataBuilder::createManyToOne方法的具體用法?PHP ClassMetadataBuilder::createManyToOne怎麽用?PHP ClassMetadataBuilder::createManyToOne使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder的用法示例。


在下文中一共展示了ClassMetadataBuilder::createManyToOne方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('email_stats_devices')->setCustomRepositoryClass('Mautic\\EmailBundle\\Entity\\StatDeviceRepository')->addIndex(['date_opened'], 'date_opened_search');
     $builder->addId();
     $builder->createManyToOne('device', 'Mautic\\LeadBundle\\Entity\\LeadDevice')->addJoinColumn('device_id', 'id', true, false, 'CASCADE')->build();
     $builder->createManyToOne('stat', 'Stat')->addJoinColumn('stat_id', 'id', true, false, 'CASCADE')->build();
     $builder->addIpAddress(true);
     $builder->createField('dateOpened', 'datetime')->columnName('date_opened')->build();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:13,代碼來源:StatDevice.php

示例2: 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

示例3: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('oauth1_access_tokens')->addIndex(['token'], 'oauth1_access_token_search');
     $builder->createField('id', 'integer')->isPrimaryKey()->generatedValue()->build();
     $builder->createManyToOne('consumer', 'Consumer')->inversedBy('accessTokens')->addJoinColumn('consumer_id', 'id', false, false, 'CASCADE')->build();
     $builder->createManyToOne('user', 'Mautic\\UserBundle\\Entity\\User')->addJoinColumn('user_id', 'id', false, false, 'CASCADE')->build();
     $builder->addField('token', 'string');
     $builder->addField('secret', 'string');
     $builder->createField('expiresAt', 'bigint')->columnName('expires_at')->nullable()->build();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:14,代碼來源:AccessToken.php

示例4: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('oauth2_refreshtokens')->addIndex(array('token'), 'oauth2_refresh_token_search');
     $builder->createField('id', 'integer')->isPrimaryKey()->generatedValue()->build();
     $builder->createManyToOne('client', 'Client')->addJoinColumn('client_id', 'id', false, false, 'CASCADE')->build();
     $builder->createManyToOne('user', 'Mautic\\UserBundle\\Entity\\User')->addJoinColumn('user_id', 'id', false, false, 'CASCADE')->build();
     $builder->createField('token', 'string')->unique()->build();
     $builder->createField('expiresAt', 'bigint')->columnName('expires_at')->nullable()->build();
     $builder->createField('scope', 'string')->nullable()->build();
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:14,代碼來源:RefreshToken.php

示例5: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('form_submissions')->setCustomRepositoryClass('Mautic\\FormBundle\\Entity\\SubmissionRepository')->addIndex(['tracking_id'], 'form_submission_tracking_search')->addIndex(['date_submitted'], 'form_date_submitted');
     $builder->addId();
     $builder->createManyToOne('form', 'Form')->inversedBy('submissions')->addJoinColumn('form_id', 'id', false, false, 'CASCADE')->build();
     $builder->addIpAddress();
     $builder->addLead(true, 'SET NULL');
     $builder->createField('trackingId', 'string')->columnName('tracking_id')->nullable()->build();
     $builder->createField('dateSubmitted', 'datetime')->columnName('date_submitted')->build();
     $builder->addField('referer', 'text');
     $builder->createManyToOne('page', 'Mautic\\PageBundle\\Entity\\Page')->addJoinColumn('page_id', 'id', true, false, 'SET NULL')->fetchExtraLazy()->build();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:16,代碼來源:Submission.php

示例6: loadMetadata

 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('opportunities')->setCustomRepositoryClass('MauticPlugin\\CustomCrmBundle\\Entity\\OpportunityRepository');
     $builder->createField('id', 'integer')->isPrimaryKey()->generatedValue()->build();
     $builder->createField('status', 'string')->length(32)->build();
     $builder->createField('confidence', 'integer')->nullable()->build();
     $builder->createField('value', 'integer')->nullable()->build();
     $builder->createField('valueType', 'string')->length(32)->columnName('value_type')->nullable()->build();
     $builder->createField('estimatedClose', 'date')->columnName('estimated_close')->nullable()->build();
     $builder->createField('comments', 'text')->nullable()->build();
     $builder->createManyToOne('lead', 'Mautic\\LeadBundle\\Entity\\Lead')->addJoinColumn('lead_id', 'id', false, false)->cascadePersist()->build();
     $builder->createManyToOne('ownerUser', 'Mautic\\UserBundle\\Entity\\User')->addJoinColumn('owner_user_id', 'id', true, false)->build();
 }
開發者ID:redmantech,項目名稱:Mautic_CRM,代碼行數:14,代碼來源:Opportunity.php

示例7: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('webhook_queue')->setCustomRepositoryClass('Mautic\\WebhookBundle\\Entity\\WebhookQueueRepository');
     $builder->addId();
     // M:1 for webhook
     $builder->createManyToOne('webhook', 'Webhook')->inversedBy('queues')->addJoinColumn('webhook_id', 'id', false, false, 'CASCADE')->build();
     // date added
     $builder->createField('dateAdded', 'datetime')->columnName('date_added')->nullable()->build();
     // payload
     $builder->createField('payload', 'text')->columnName('payload')->build();
     // M:1 for event
     $builder->createManyToOne('event', 'Event')->inversedBy('queues')->addJoinColumn('event_id', 'id', false, false, 'CASCADE')->build();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:17,代碼來源:WebhookQueue.php

示例8: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('sms_message_stats')->setCustomRepositoryClass('Mautic\\SmsBundle\\Entity\\StatRepository')->addIndex(['sms_id', 'lead_id'], 'stat_sms_search')->addIndex(['tracking_hash'], 'stat_sms_hash_search')->addIndex(['source', 'source_id'], 'stat_sms_source_search');
     $builder->addId();
     $builder->createManyToOne('sms', 'Sms')->inversedBy('stats')->addJoinColumn('sms_id', 'id', true, false, 'SET NULL')->build();
     $builder->addLead(true, 'SET NULL');
     $builder->createManyToOne('list', 'Mautic\\LeadBundle\\Entity\\LeadList')->addJoinColumn('list_id', 'id', true, false, 'SET NULL')->build();
     $builder->addIpAddress(true);
     $builder->createField('dateSent', 'datetime')->columnName('date_sent')->build();
     $builder->createField('trackingHash', 'string')->columnName('tracking_hash')->nullable()->build();
     $builder->createField('source', 'string')->nullable()->build();
     $builder->createField('sourceId', 'integer')->columnName('source_id')->nullable()->build();
     $builder->createField('tokens', 'array')->nullable()->build();
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:18,代碼來源:Stat.php

示例9: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('campaign_lead_event_log')->setCustomRepositoryClass('Mautic\\CampaignBundle\\Entity\\LeadEventLogRepository')->addIndex(array('is_scheduled'), 'event_upcoming_search');
     $builder->createManyToOne('event', 'Event')->isPrimaryKey()->inversedBy('log')->addJoinColumn('event_id', 'id', false, false, 'CASCADE')->build();
     $builder->addLead(false, 'CASCADE', true);
     $builder->createManyToOne('campaign', 'Campaign')->addJoinColumn('campaign_id', 'id')->build();
     $builder->addIpAddress(true);
     $builder->createField('dateTriggered', 'datetime')->columnName('date_triggered')->nullable()->build();
     $builder->createField('isScheduled', 'boolean')->columnName('is_scheduled')->build();
     $builder->createField('triggerDate', 'datetime')->columnName('trigger_date')->nullable()->build();
     $builder->createField('systemTriggered', 'boolean')->columnName('system_triggered')->build();
     $builder->createField('metadata', 'array')->nullable()->build();
     $builder->addNullableField('nonActionPathTaken', 'boolean', 'non_action_path_taken');
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:18,代碼來源:LeadEventLog.php

示例10: addVariantMetadata

 /**
  * @param ClassMetadata $builder
  * @param               $entityClass
  */
 protected static function addVariantMetadata(ClassMetadataBuilder $builder, $entityClass)
 {
     $builder->createManyToOne('variantParent', $entityClass)->inversedBy('variantChildren')->addJoinColumn('variant_parent_id', 'id', true, false, 'CASCADE')->build();
     $builder->createOneToMany('variantChildren', $entityClass)->setIndexBy('id')->setOrderBy(['isPublished' => 'DESC'])->mappedBy('variantParent')->build();
     $builder->createField('variantSettings', 'array')->columnName('variant_settings')->nullable()->build();
     $builder->createField('variantStartDate', 'datetime')->columnName('variant_start_date')->nullable()->build();
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:11,代碼來源:VariantEntityTrait.php

示例11: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('asset_downloads')->setCustomRepositoryClass('Mautic\\AssetBundle\\Entity\\DownloadRepository')->addIndex(['tracking_id'], 'download_tracking_search')->addIndex(['source', 'source_id'], 'download_source_search')->addIndex(['date_download'], 'asset_date_download');
     $builder->createField('id', 'integer')->isPrimaryKey()->generatedValue()->build();
     $builder->createField('dateDownload', 'datetime')->columnName('date_download')->build();
     $builder->createManyToOne('asset', 'Asset')->addJoinColumn('asset_id', 'id', true, false, 'CASCADE')->build();
     $builder->addIpAddress();
     $builder->addLead(true, 'SET NULL');
     $builder->addField('code', 'integer');
     $builder->createField('referer', 'string')->nullable()->build();
     $builder->createField('trackingId', 'string')->columnName('tracking_id')->build();
     $builder->createField('source', 'string')->nullable()->build();
     $builder->createField('sourceId', 'integer')->columnName('source_id')->nullable()->build();
     $builder->createManyToOne('email', 'Mautic\\EmailBundle\\Entity\\Email')->addJoinColumn('email_id', 'id', true, false, 'SET NULL')->build();
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:19,代碼來源:Download.php

示例12: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('companies')->setCustomRepositoryClass('Mautic\\LeadBundle\\Entity\\CompanyRepository');
     $builder->createField('id', 'integer')->isPrimaryKey()->generatedValue()->build();
     $builder->createManyToOne('owner', 'Mautic\\UserBundle\\Entity\\User')->addJoinColumn('owner_id', 'id', true, false, 'SET NULL')->build();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:10,代碼來源:Company.php

示例13: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('push_ids')->setCustomRepositoryClass('Mautic\\NotificationBundle\\Entity\\PushIDRepository');
     $builder->createField('id', 'integer')->isPrimaryKey()->generatedValue()->build();
     $builder->createField('pushID', 'string')->columnName('push_id')->nullable(false)->build();
     $builder->createManyToOne('lead', 'Mautic\\LeadBundle\\Entity\\Lead')->addJoinColumn('lead_id', 'id', true, false, 'SET NULL')->inversedBy('pushIds')->build();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:11,代碼來源:PushID.php

示例14: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('monitoring_leads')->setCustomRepositoryClass('MauticPlugin\\MauticSocialBundle\\Entity\\LeadRepository');
     $builder->createManyToOne('monitor', 'Monitoring')->isPrimaryKey()->addJoinColumn('monitor_id', 'id', false, false, 'CASCADE')->build();
     $builder->addLead(false, 'CASCADE', true);
     $builder->addNamedField('dateAdded', 'datetime', 'date_added');
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:11,代碼來源:Lead.php

示例15: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('point_lead_action_log')->setCustomRepositoryClass('Mautic\\PointBundle\\Entity\\LeadPointLogRepository');
     $builder->createManyToOne('point', 'Point')->isPrimaryKey()->addJoinColumn('point_id', 'id', true, false, 'CASCADE')->inversedBy('log')->build();
     $builder->addLead(false, 'CASCADE', true);
     $builder->addIpAddress(true);
     $builder->createField('dateFired', 'datetime')->columnName('date_fired')->build();
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:12,代碼來源:LeadPointLog.php


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