本文整理匯總了PHP中Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder::addNamedField方法的典型用法代碼示例。如果您正苦於以下問題:PHP ClassMetadataBuilder::addNamedField方法的具體用法?PHP ClassMetadataBuilder::addNamedField怎麽用?PHP ClassMetadataBuilder::addNamedField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder
的用法示例。
在下文中一共展示了ClassMetadataBuilder::addNamedField方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('monitor_post_count')->setCustomRepositoryClass('MauticPlugin\\MauticSocialBundle\\Entity\\PostCountRepository');
$builder->addId();
$builder->createManyToOne('monitor', 'Monitoring')->addJoinColumn('monitor_id', 'id', true, false, 'CASCADE')->build();
$builder->addNamedField('postDate', 'date', 'post_date');
$builder->addNamedField('postCount', 'integer', 'post_count');
}
示例2: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('focus_stats')->setCustomRepositoryClass('MauticPlugin\\MauticFocusBundle\\Entity\\StatRepository')->addIndex(['type'], 'focus_type')->addIndex(['type', 'type_id'], 'focus_type_id')->addIndex(['date_added'], 'focus_date_added');
$builder->addId();
$builder->createManyToOne('focus', 'Focus')->addJoinColumn('focus_id', 'id', false, false, 'CASCADE')->build();
$builder->addField('type', 'string');
$builder->addNamedField('typeId', 'integer', 'type_id', true);
$builder->addNamedField('dateAdded', 'datetime', 'date_added');
}
示例3: 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');
}
示例4: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('channel_url_trackables')->setCustomRepositoryClass('Mautic\\PageBundle\\Entity\\TrackableRepository')->addIndex(['channel', 'channel_id'], 'channel_url_trackable_search');
$builder->createManyToOne('redirect', 'Mautic\\PageBundle\\Entity\\Redirect')->addJoinColumn('redirect_id', 'id', true, false, 'CASCADE')->cascadePersist()->inversedBy('trackables')->isPrimaryKey()->build();
$builder->createField('channelId', 'integer')->columnName('channel_id')->isPrimaryKey()->build();
$builder->addField('channel', 'string');
$builder->addField('hits', 'integer');
$builder->addNamedField('uniqueHits', 'integer', 'unique_hits');
}
示例5: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('lead_frequencyrules')->setCustomRepositoryClass('Mautic\\LeadBundle\\Entity\\FrequencyRuleRepository')->addIndex(['channel'], 'channel_frequency');
$builder->addId();
$builder->addLead(false, 'CASCADE', false, 'frequencyRules');
$builder->addDateAdded();
$builder->addNamedField('frequencyNumber', 'smallint', 'frequency_number');
$builder->createField('frequencyTime', 'string')->columnName('frequency_time')->length(25)->build();
$builder->createField('channel', 'string')->build();
}
示例6: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('lead_donotcontact')->setCustomRepositoryClass('Mautic\\LeadBundle\\Entity\\DoNotContactRepository')->addIndex(['reason'], 'dnc_reason_search');
$builder->addId();
$builder->addLead(true, 'CASCADE', false, 'doNotContact');
$builder->addDateAdded();
$builder->createField('reason', 'smallint')->build();
$builder->createField('channel', 'string')->build();
$builder->addNamedField('channelId', 'integer', 'channel_id', true);
$builder->createField('comments', 'text')->nullable()->build();
}
示例7: 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();
}
示例8: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('page_redirects')->setCustomRepositoryClass('Mautic\\PageBundle\\Entity\\RedirectRepository');
$builder->addId();
$builder->createField('redirectId', 'string')->columnName('redirect_id')->length(25)->build();
$builder->addField('url', 'text');
$builder->addField('hits', 'integer');
$builder->createField('uniqueHits', 'integer')->columnName('unique_hits')->build();
$builder->createOneToMany('trackables', 'Trackable')->mappedBy('redirect')->fetchExtraLazy()->build();
// @deprecated to be removed in 2.0
$builder->addNamedField('email', 'integer', 'email_id', true);
}
示例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(['is_scheduled'], 'event_upcoming_search')->addIndex(['date_triggered'], 'campaign_date_triggered')->addIndex(['lead_id', 'campaign_id'], 'campaign_leads');
$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('channel', 'string');
$builder->addNamedField('channelId', 'integer', 'channel_id', true);
$builder->addNullableField('nonActionPathTaken', 'boolean', 'non_action_path_taken');
}
示例10: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('focus')->setCustomRepositoryClass('MauticPlugin\\MauticFocusBundle\\Entity\\FocusRepository')->addIndex(['focus_type'], 'focus_type')->addIndex(['style'], 'focus_style')->addIndex(['form_id'], 'focus_form');
$builder->addIdColumns();
$builder->addCategory();
$builder->addNamedField('type', 'string', 'focus_type');
$builder->addField('style', 'string');
$builder->addNullableField('website', 'string');
$builder->addPublishDates();
$builder->addNullableField('properties', 'array');
$builder->addNamedField('form', 'integer', 'form_id', true);
$builder->addNullableField('cache', 'text');
}
示例11: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('message_queue')->setCustomRepositoryClass('Mautic\\CoreBundle\\Entity\\MessageQueueRepository')->addIndex(['status'], 'message_status_search')->addIndex(['date_sent'], 'message_date_sent')->addIndex(['scheduled_date'], 'message_scheduled_date')->addIndex(['priority'], 'message_priority')->addIndex(['success'], 'message_success')->addIndex(['channel', 'channel_id'], 'message_channel_search');
$builder->addId();
$builder->addField('channel', 'string');
$builder->addNamedField('channelId', 'integer', 'channel_id');
$builder->createManyToOne('event', 'Mautic\\CampaignBundle\\Entity\\Event')->addJoinColumn('event_id', 'id', true, false, 'CASCADE')->build();
$builder->addLead(false, 'CASCADE', false);
$builder->createField('priority', 'smallint')->columnName('priority')->build();
$builder->createField('maxAttempts', 'smallint')->columnName('max_attempts')->build();
$builder->createField('attempts', 'smallint')->columnName('attempts')->build();
$builder->createField('success', 'boolean')->columnName('success')->build();
$builder->createField('status', 'string')->columnName('status')->build();
$builder->createField('datePublished', 'datetime')->columnName('date_published')->nullable()->build();
$builder->createField('scheduledDate', 'datetime')->columnName('scheduled_date')->nullable()->build();
$builder->createField('lastAttempt', 'datetime')->columnName('last_attempt')->nullable()->build();
$builder->createField('dateSent', 'datetime')->columnName('date_sent')->nullable()->build();
$builder->createField('options', 'array')->nullable()->build();
}