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


PHP ClassMetadataBuilder::addField方法代碼示例

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


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

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

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

示例3: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('oauth1_access_tokens')->addIndex(array('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:Jandersolutions,項目名稱:mautic,代碼行數:14,代碼來源:AccessToken.php

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

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

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

示例7: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('email_donotemail')->setCustomRepositoryClass('Mautic\\CoreBundle\\Entity\\NotificationRepository')->addIndex(array('address'), 'dnc_search');
     $builder->addId();
     $builder->createManyToOne('email', 'Email')->addJoinColumn('email_id', 'id', true, false, 'SET NULL')->build();
     $builder->createField('emailAddress', 'string')->columnName('address')->build();
     $builder->addLead(true, 'CASCADE', false, 'doNotEmail');
     $builder->addDateAdded();
     $builder->addField('unsubscribed', 'boolean');
     $builder->addField('bounced', 'boolean');
     $builder->addNullableField('manual', 'boolean');
     $builder->createField('comments', 'text')->nullable()->build();
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:17,代碼來源:DoNotEmail.php

示例8: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('oauth1_nonces')->setCustomRepositoryClass('Mautic\\ApiBundle\\Entity\\oAuth1\\NonceRepository');
     $builder->createField('nonce', 'string')->isPrimaryKey()->build();
     $builder->addField('timestamp', 'string');
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:10,代碼來源:Nonce.php

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

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

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

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

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

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

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


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