本文整理匯總了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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');
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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');
}
示例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();
}