Skip to content

Commit 31cc99c

Browse files
committed
Properly nest ClassMetadataBuilder methods under class
1 parent eee2c48 commit 31cc99c

File tree

1 file changed

+96
-96
lines changed

1 file changed

+96
-96
lines changed

docs/plugins/data.rst

Lines changed: 96 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -16,166 +16,166 @@ You can build the schema through Doctrine's ``Doctrine\ORM\Mapping\Builder\Class
1616

1717
.. php:class:: Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder
1818
19-
.. php:method:: addBigIntIdField([string $fieldName = 'id', string $columnName = 'id', bool $isPrimary = true, boolean $isNullable = false])
19+
.. php:method:: addBigIntIdField([string $fieldName = 'id', string $columnName = 'id', bool $isPrimary = true, boolean $isNullable = false])
2020
21-
Adds autogenerated ID field type of BIGINT UNSIGNED
21+
Adds autogenerated ID field type of BIGINT UNSIGNED
2222

23-
:param string $fieldName: Name of the ORM field.
24-
:param string $columnName: Name of the column created in the database table.
25-
:param boolean $isPrimary: ``TRUE`` to configure this field as a primary key for the table.
26-
:param bool $isNullable: ``TRUE`` to allow ``NULL`` values.
23+
:param string $fieldName: Name of the ORM field.
24+
:param string $columnName: Name of the column created in the database table.
25+
:param boolean $isPrimary: ``TRUE`` to configure this field as a primary key for the table.
26+
:param bool $isNullable: ``TRUE`` to allow ``NULL`` values.
2727

28-
:returns: ``$this``
29-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
28+
:returns: ``$this``
29+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
3030

31-
.. php:method:: addCategory()
31+
.. php:method:: addCategory()
3232
33-
Creates a many to one relationship with `Mautic\CategoryBundle\Entity\Category`. Defines a ``category`` ORM property mapped to a ``category_id`` column on the table with a foreign key to ``categories.id``.
33+
Creates a many to one relationship with `Mautic\CategoryBundle\Entity\Category`. Defines a ``category`` ORM property mapped to a ``category_id`` column on the table with a foreign key to ``categories.id``.
3434

35-
:returns: ``$this``
36-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
35+
:returns: ``$this``
36+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
3737

38-
.. php:method:: addContact([bool $nullable = false, string $onDelete = 'CASCADE', bool $isPrimaryKey = false, ?string $inversedBy = null)
38+
.. php:method:: addContact([bool $nullable = false, string $onDelete = 'CASCADE', bool $isPrimaryKey = false, ?string $inversedBy = null)
3939
40-
Creates a many to one relationship with `Mautic\LeadBundle\Entity\Lead`. Defines a ``contact`` ORM property mapped to a ``contact_id`` column on the table with a foreign key to ``leads.id``.
40+
Creates a many to one relationship with `Mautic\LeadBundle\Entity\Lead`. Defines a ``contact`` ORM property mapped to a ``contact_id`` column on the table with a foreign key to ``leads.id``.
4141

42-
:param bool $nullable: ``TRUE`` to allow ``NULL`` values.
43-
:param string $onDelete: Foreign key reference option such as ``CASCADE`` or ``SET NULL``.
44-
:param bool $isPrimaryKey: ``TRUE`` to configure this field as a primary key for the table.
45-
:param string|null $inversedBy: Property on the ``Mautic\LeadBundle\Entity\Lead`` entity this relates to. This is only used by Core.
42+
:param bool $nullable: ``TRUE`` to allow ``NULL`` values.
43+
:param string $onDelete: Foreign key reference option such as ``CASCADE`` or ``SET NULL``.
44+
:param bool $isPrimaryKey: ``TRUE`` to configure this field as a primary key for the table.
45+
:param string|null $inversedBy: Property on the ``Mautic\LeadBundle\Entity\Lead`` entity this relates to. This is only used by Core.
4646

47-
:returns: ``$this``
48-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
47+
:returns: ``$this``
48+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
4949

50-
.. php:method:: addDateAdded([bool $nullable = false])
50+
.. php:method:: addDateAdded([bool $nullable = false])
5151
52-
Creates a mutable date/time field. Defines a ``dateAdded`` ORM property mapped to a ``date_added`` column on the table.
52+
Creates a mutable date/time field. Defines a ``dateAdded`` ORM property mapped to a ``date_added`` column on the table.
5353

54-
:param bool $nullable: ``TRUE`` to allow ``NULL`` values.
54+
:param bool $nullable: ``TRUE`` to allow ``NULL`` values.
5555

56-
:returns: ``$this``
57-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
56+
:returns: ``$this``
57+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
5858

59-
.. php:method:: addField(string $name, string $type[, array $mapping = []])
59+
.. php:method:: addField(string $name, string $type[, array $mapping = []])
6060
61-
Decorates ``Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder::addField`` that sets the max length to 191 characters for string typed or indexed fields for compatibility with UTF8MB4 encoding.
61+
Decorates ``Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder::addField`` that sets the max length to 191 characters for string typed or indexed fields for compatibility with UTF8MB4 encoding.
6262

63-
:param string $name: Name of the ORM field.
64-
:param string $type: Doctrine field type. See ``Doctrine\DBAL\Types\Types``.
65-
:param array $mapping: Custom field definitions.
63+
:param string $name: Name of the ORM field.
64+
:param string $type: Doctrine field type. See ``Doctrine\DBAL\Types\Types``.
65+
:param array $mapping: Custom field definitions.
6666

67-
:returns: ``$this``
68-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
67+
:returns: ``$this``
68+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
6969

70-
.. php:method:: addId()
70+
.. php:method:: addId()
7171
72-
:returns: ``$this``
73-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
72+
:returns: ``$this``
73+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
7474

75-
.. php:method:: addIdColumns([string $nameColumn = 'name', string $descriptionColumn = 'description'])
75+
.. php:method:: addIdColumns([string $nameColumn = 'name', string $descriptionColumn = 'description'])
7676
77-
Creates ``id``, ``name``, and ``description`` ORM fields. ``id`` is an auto-incremented unsigned integer set as a primary key. ``name`` is created as ``varchar(191)`` and ``description`` as ``longtext``. Customize the ORM names for ``name`` and ``description`` through the optional parameters.
77+
Creates ``id``, ``name``, and ``description`` ORM fields. ``id`` is an auto-incremented unsigned integer set as a primary key. ``name`` is created as ``varchar(191)`` and ``description`` as ``longtext``. Customize the ORM names for ``name`` and ``description`` through the optional parameters.
7878

79-
:param string $nameColumn: Customize the name for the ``name`` field.
80-
:param string $descriptionColumn: Customize the name for the ``description`` field.
79+
:param string $nameColumn: Customize the name for the ``name`` field.
80+
:param string $descriptionColumn: Customize the name for the ``description`` field.
8181

82-
:returns: ``$this``
83-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
82+
:returns: ``$this``
83+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
8484

85-
.. php:method:: addIpAddress([bool $nullable = false])
85+
.. php:method:: addIpAddress([bool $nullable = false])
8686
87-
Creates a many to one relationship with `Mautic\CoreBundle\Entity\IpAddress`. Defines a ``ipAddress`` ORM property mapped to a ``ip_id`` column on the table with a foreign key to ``ip_addresses.id``.
87+
Creates a many to one relationship with `Mautic\CoreBundle\Entity\IpAddress`. Defines a ``ipAddress`` ORM property mapped to a ``ip_id`` column on the table with a foreign key to ``ip_addresses.id``.
8888

89-
:param bool $nullable: ``TRUE`` to allow ``NULL`` values.
89+
:param bool $nullable: ``TRUE`` to allow ``NULL`` values.
9090

91-
:returns: ``$this``
92-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
91+
:returns: ``$this``
92+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
9393

94-
.. php:method:: addNamedField(string $name, string $type, string $columnName[, $nullable = false])
94+
.. php:method:: addNamedField(string $name, string $type, string $columnName[, $nullable = false])
9595
96-
Creates a field with a custom column name.
96+
Creates a field with a custom column name.
9797

98-
:param string $name: Name of the ORM field.
99-
:param string $type: Doctrine field type. See ``Doctrine\DBAL\Types\Types``.
100-
:param string $columnName: Name of the table's column name.
101-
:param bool $nullable: ``TRUE`` to allow ``NULL`` values.
98+
:param string $name: Name of the ORM field.
99+
:param string $type: Doctrine field type. See ``Doctrine\DBAL\Types\Types``.
100+
:param string $columnName: Name of the table's column name.
101+
:param bool $nullable: ``TRUE`` to allow ``NULL`` values.
102102

103-
:returns: ``$this``
104-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
103+
:returns: ``$this``
104+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
105105

106-
.. php:method:: addNullableField(string $name[, string $type = Types::STRING, ?string $columnName = null])
106+
.. php:method:: addNullableField(string $name[, string $type = Types::STRING, ?string $columnName = null])
107107
108-
Creates a field that allows a ``NULL`` value.
108+
Creates a field that allows a ``NULL`` value.
109109

110-
:param string $name: Name of the ORM field.
111-
:param string $type: Doctrine field type. See ``Doctrine\DBAL\Types\Types``.
112-
:param string $columnName: Name of the table's column name.
110+
:param string $name: Name of the ORM field.
111+
:param string $type: Doctrine field type. See ``Doctrine\DBAL\Types\Types``.
112+
:param string $columnName: Name of the table's column name.
113113

114-
:returns: ``$this``
115-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
114+
:returns: ``$this``
115+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
116116

117-
.. php:method:: addPublishDates()
117+
.. php:method:: addPublishDates()
118118
119-
Creates ``publishUp`` and ``publishDown`` nullable mutable date/time fields as ``publish_up`` and ``publish_down`` respectively.
119+
Creates ``publishUp`` and ``publishDown`` nullable mutable date/time fields as ``publish_up`` and ``publish_down`` respectively.
120120

121-
:returns: ``$this``
122-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
121+
:returns: ``$this``
122+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
123123

124-
.. php:method:: addUuid()
124+
.. php:method:: addUuid()
125125
126-
Creates a ``id`` GUID field as a primary key. You should generate a UUID in the entity's ``__construct`` or pass one into the ``__construct`` when creating a new entity. You can use ``$this->id = Ramsey\Uuid\Uuid::uuid4()->toString();``.
126+
Creates a ``id`` GUID field as a primary key. You should generate a UUID in the entity's ``__construct`` or pass one into the ``__construct`` when creating a new entity. You can use ``$this->id = Ramsey\Uuid\Uuid::uuid4()->toString();``.
127127

128-
:returns: ``$this``
129-
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
128+
:returns: ``$this``
129+
:returntype: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ClassMetadataBuilder
130130

131-
.. php:method:: createField(string $name, string $type)
131+
.. php:method:: createField(string $name, string $type)
132132
133-
Instantiates and returns a ``Doctrine\ORM\Mapping\Builder\FieldBuilder`` object. ``length`` is set if the field is a string type or indexed.
133+
Instantiates and returns a ``Doctrine\ORM\Mapping\Builder\FieldBuilder`` object. ``length`` is set if the field is a string type or indexed.
134134

135-
:returns: \\Doctrine\\ORM\\Mapping\\Builder\\FieldBuilder
135+
:returns: \\Doctrine\\ORM\\Mapping\\Builder\\FieldBuilder
136136

137-
.. php:method:: createManyToMany(string $name, string $targetEntity)
137+
.. php:method:: createManyToMany(string $name, string $targetEntity)
138138
139-
Creates a many to many field to the targeted entity. Instantiates and returns a ``Mautic\CoreBundle\Doctrine\Mapping\ManyToManyAssociationBuilder`` object that decorates ``Doctrine\ORM\Mapping\Builder\ManyToManyAssociationBuilder`` with ``orphanRemoval()`` support.
139+
Creates a many to many field to the targeted entity. Instantiates and returns a ``Mautic\CoreBundle\Doctrine\Mapping\ManyToManyAssociationBuilder`` object that decorates ``Doctrine\ORM\Mapping\Builder\ManyToManyAssociationBuilder`` with ``orphanRemoval()`` support.
140140

141-
:param string $name: Name of the ORM field.
142-
:param string $targetEntity: Fully qualified classname for the targeted entity.
141+
:param string $name: Name of the ORM field.
142+
:param string $targetEntity: Fully qualified classname for the targeted entity.
143143

144-
:returns: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ManyToManyAssociationBuilder
144+
:returns: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\ManyToManyAssociationBuilder
145145

146-
.. php:method:: createManyToOne(string $name, string $targetEntity)
146+
.. php:method:: createManyToOne(string $name, string $targetEntity)
147147
148-
Creates a field with a many to one relationship to the targeted entity. Instantiates and returns a ``Mautic\CoreBundle\Doctrine\Mapping\AssociationBuilder`` object that decorates ``Doctrine\ORM\Mapping\Builder\AssociationBuilder`` with ``orphanRemoval()`` and ``isPrimaryKey()`` support.
148+
Creates a field with a many to one relationship to the targeted entity. Instantiates and returns a ``Mautic\CoreBundle\Doctrine\Mapping\AssociationBuilder`` object that decorates ``Doctrine\ORM\Mapping\Builder\AssociationBuilder`` with ``orphanRemoval()`` and ``isPrimaryKey()`` support.
149149

150-
:param string $name: Name of the ORM field.
151-
:param string $targetEntity: Fully qualified classname for the targeted entity.
150+
:param string $name: Name of the ORM field.
151+
:param string $targetEntity: Fully qualified classname for the targeted entity.
152152

153-
:returns: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\AssociationBuilder
153+
:returns: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\AssociationBuilder
154154

155-
.. php:method:: createOneToMany(string $name, string $targetEntity)
155+
.. php:method:: createOneToMany(string $name, string $targetEntity)
156156
157-
Creates a field with a one to many relationship to the targeted entity. Instantiates and returns a ``Mautic\CoreBundle\Doctrine\Mapping\OneToManyAssociationBuilder`` object that decorates ``Doctrine\ORM\Mapping\Builder\OneToManyAssociationBuilder`` with ``orphanRemoval()`` support.
157+
Creates a field with a one to many relationship to the targeted entity. Instantiates and returns a ``Mautic\CoreBundle\Doctrine\Mapping\OneToManyAssociationBuilder`` object that decorates ``Doctrine\ORM\Mapping\Builder\OneToManyAssociationBuilder`` with ``orphanRemoval()`` support.
158158

159-
:param string $name: Name of the ORM field.
160-
:param string $targetEntity: Fully qualified classname for the targeted entity.
159+
:param string $name: Name of the ORM field.
160+
:param string $targetEntity: Fully qualified classname for the targeted entity.
161161

162-
:returns: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\OneToManyAssociationBuilder
162+
:returns: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\OneToManyAssociationBuilder
163163

164-
.. php:method:: createOneToOne(string $name, string $targetEntity)
164+
.. php:method:: createOneToOne(string $name, string $targetEntity)
165165
166-
Creates a field with a one to one relationship to the targeted entity. Instantiates and returns a ``Mautic\CoreBundle\Doctrine\Mapping\AssociationBuilder`` object that decorates ``Doctrine\ORM\Mapping\Builder\AssociationBuilder`` with ``orphanRemoval()`` and ``isPrimaryKey()`` support.
166+
Creates a field with a one to one relationship to the targeted entity. Instantiates and returns a ``Mautic\CoreBundle\Doctrine\Mapping\AssociationBuilder`` object that decorates ``Doctrine\ORM\Mapping\Builder\AssociationBuilder`` with ``orphanRemoval()`` and ``isPrimaryKey()`` support.
167167

168-
:param string $name: Name of the ORM field.
169-
:param string $targetEntity: Fully qualified classname for the targeted entity.
168+
:param string $name: Name of the ORM field.
169+
:param string $targetEntity: Fully qualified classname for the targeted entity.
170170

171-
:returns: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\AssociationBuilder
171+
:returns: \\Mautic\\CoreBundle\\Doctrine\\Mapping\\AssociationBuilder
172172

173-
.. php:method:: isIndexedVarchar(string $name, string $type)
173+
.. php:method:: isIndexedVarchar(string $name, string $type)
174174
175-
Checks whether the field should have a max length of 191 configured for compatibility with UTF8MB4 encoded fields.
175+
Checks whether the field should have a max length of 191 configured for compatibility with UTF8MB4 encoded fields.
176176

177-
:returns: Returns ``TRUE`` if the field is a ``string`` type or is indexed.
178-
:returntype: bool
177+
:returns: Returns ``TRUE`` if the field is a ``string`` type or is indexed.
178+
:returntype: bool
179179

180180
Entity annotations
181181
******************

0 commit comments

Comments
 (0)