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


PHP ClassMetadataBuilder::createField方法代碼示例

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


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

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

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

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

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

示例5: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('email_copies')->setCustomRepositoryClass('Mautic\\EmailBundle\\Entity\\CopyRepository');
     $builder->createField('id', 'string')->isPrimaryKey()->length(32)->build();
     $builder->createField('dateCreated', 'datetime')->columnName('date_created')->build();
     $builder->addNullableField('body', 'text');
     $builder->addNullableField('subject', 'text');
 }
開發者ID:Yame-,項目名稱:mautic,代碼行數:12,代碼來源:Copy.php

示例6: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('roles')->setCustomRepositoryClass('Mautic\\UserBundle\\Entity\\RoleRepository');
     $builder->addIdColumns();
     $builder->createField('isAdmin', 'boolean')->columnName('is_admin')->build();
     $builder->createOneToMany('permissions', 'Permission')->orphanRemoval()->mappedBy('role')->cascadePersist()->cascadeRemove()->fetchExtraLazy()->build();
     $builder->createField('rawPermissions', 'array')->columnName('readable_permissions')->build();
     $builder->createOneToMany('users', 'User')->mappedBy('role')->fetchExtraLazy()->build();
 }
開發者ID:spdaly,項目名稱:mautic,代碼行數:13,代碼來源:Role.php

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

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

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

示例10: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('companies_leads')->setCustomRepositoryClass('Mautic\\LeadBundle\\Entity\\CompanyLeadRepository');
     $builder->createManyToOne('company', 'Company')->isPrimaryKey()->inversedBy('leads')->addJoinColumn('company_id', 'id', false, false, 'CASCADE')->build();
     $builder->addLead(false, 'CASCADE', true);
     $builder->addDateAdded();
     $builder->createField('manuallyRemoved', 'boolean')->columnName('manually_removed')->build();
     $builder->createField('manuallyAdded', 'boolean')->columnName('manually_added')->build();
 }
開發者ID:dongilbert,項目名稱:mautic,代碼行數:13,代碼來源:CompanyLead.php

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

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

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

示例14: loadMetadata

 /**
  * @param ORM\ClassMetadata $metadata
  */
 public static function loadMetadata(ORM\ClassMetadata $metadata)
 {
     $builder = new ClassMetadataBuilder($metadata);
     $builder->setTable('oauth2_clients')->setCustomRepositoryClass('Mautic\\ApiBundle\\Entity\\oAuth2\\ClientRepository')->addIndex(array('random_id'), 'client_id_search');
     $builder->addIdColumns('name', false);
     $builder->createManyToMany('users', 'Mautic\\UserBundle\\Entity\\User')->setJoinTable('oauth2_user_client_xref')->addInverseJoinColumn('user_id', 'id', false, false, 'CASCADE')->addJoinColumn('client_id', 'id', false, false, 'CASCADE')->fetchExtraLazy()->build();
     $builder->createField('randomId', 'string')->columnName('random_id')->build();
     $builder->addField('secret', 'string');
     $builder->createField('redirectUris', 'array')->columnName('redirect_uris')->build();
     $builder->createField('allowedGrantTypes', 'array')->columnName('allowed_grant_types')->build();
 }
開發者ID:Jandersolutions,項目名稱:mautic,代碼行數:14,代碼來源:Client.php

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


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