本文整理匯總了PHP中Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder::addId方法的典型用法代碼示例。如果您正苦於以下問題:PHP ClassMetadataBuilder::addId方法的具體用法?PHP ClassMetadataBuilder::addId怎麽用?PHP ClassMetadataBuilder::addId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder
的用法示例。
在下文中一共展示了ClassMetadataBuilder::addId方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadMetadata
/**
* @param ClassMetadata $metadata
*/
public static function loadMetadata(ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('lead_tags')->setCustomRepositoryClass('Mautic\\LeadBundle\\Entity\\TagRepository')->addIndex(array('tag'), 'lead_tag_search');
$builder->addId();
$builder->addField('tag', 'string');
}
示例2: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('ip_addresses')->setCustomRepositoryClass('Mautic\\CoreBundle\\Entity\\IpAddressRepository')->addIndex(['ip_address'], 'ip_search');
$builder->addId();
$builder->createField('ipAddress', 'string')->columnName('ip_address')->length(45)->build();
$builder->createField('ipDetails', 'array')->columnName('ip_details')->nullable()->build();
}
示例3: 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');
}
示例4: 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();
}
示例5: 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');
}
示例6: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('permissions')->setCustomRepositoryClass('Mautic\\UserBundle\\Entity\\PermissionRepository')->addUniqueConstraint(['bundle', 'name', 'role_id'], 'unique_perm');
$builder->addId();
$builder->createField('bundle', 'string')->length(50)->build();
$builder->createField('name', 'string')->length(50)->build();
$builder->createManyToOne('role', 'Role')->inversedBy('permissions')->addJoinColumn('role_id', 'id', false, false, 'CASCADE')->build();
$builder->addField('bitwise', 'integer');
}
示例7: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('lead_notes')->setCustomRepositoryClass('Mautic\\LeadBundle\\Entity\\LeadNoteRepository');
$builder->addId();
$builder->addLead(false, 'CASCADE', false, 'notes');
$builder->addField('text', 'text');
$builder->createField('type', 'string')->length(50)->nullable()->build();
$builder->createField('dateTime', 'datetime')->columnName('date_time')->nullable()->build();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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->createManyToOne('email', 'Mautic\\EmailBundle\\Entity\\Email')->addJoinColumn('email_id', 'id', true, false, 'SET NULL')->build();
}
示例11: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('lead_stages_change_log')->setCustomRepositoryClass('Mautic\\LeadBundle\\Entity\\StagesChangeLogRepository');
$builder->addId();
$builder->addLead(false, 'CASCADE', false, 'stageChangeLog');
$builder->createField('eventName', 'string')->columnName('event_name')->build();
$builder->createField('actionName', 'string')->columnName('action_name')->build();
$builder->createManyToOne('stage', 'Mautic\\StageBundle\\Entity\\Stage')->inversedBy('stageChangeLog')->addJoinColumn('stage_id', 'id', true, false, 'CASCADE')->build();
$builder->addDateAdded();
}
示例12: 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();
}
示例13: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('lead_companies_change_log')->setCustomRepositoryClass('Mautic\\LeadBundle\\Entity\\CompanyChangeLogRepository')->addIndex(['date_added'], 'company_date_added');
$builder->addId();
$builder->addLead(false, 'CASCADE', false, 'companyChangeLog');
$builder->createField('type', 'text')->length(50)->build();
$builder->createField('eventName', 'string')->columnName('event_name')->build();
$builder->createField('actionName', 'string')->columnName('action_name')->build();
$builder->createField('company', 'integer')->columnName('company_id')->build();
$builder->addDateAdded();
}
示例14: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('webhook_logs')->setCustomRepositoryClass('Mautic\\WebhookBundle\\Entity\\LogRepository');
// id columns
$builder->addId();
// M:1 for webhook
$builder->createManyToOne('webhook', 'Webhook')->inversedBy('logs')->addJoinColumn('webhook_id', 'id', false, false, 'CASCADE')->build();
// status code
$builder->createField('statusCode', 'string')->columnName('status_code')->length(50)->build();
// date added
$builder->createField('dateAdded', 'datetime')->columnName('date_added')->nullable()->build();
}
示例15: loadMetadata
/**
* @param ORM\ClassMetadata $metadata
*/
public static function loadMetadata(ORM\ClassMetadata $metadata)
{
$builder = new ClassMetadataBuilder($metadata);
$builder->setTable('lead_points_change_log')->setCustomRepositoryClass('Mautic\\LeadBundle\\Entity\\PointsChangeLogRepository');
$builder->addId();
$builder->addLead(false, 'CASCADE', false, 'pointsChangeLog');
$builder->addIpAddress();
$builder->createField('type', 'text')->length(50)->build();
$builder->createField('eventName', 'string')->columnName('event_name')->build();
$builder->createField('actionName', 'string')->columnName('action_name')->build();
$builder->addField('delta', 'integer');
$builder->addDateAdded();
}