Skip to content

Commit 449a167

Browse files
adriendupuismnocon
andauthored
5.0: Update field type reference (#2795)
* Update field type identifiers and docs * Remove old Commerce * Draft ibexa_product_specification * Continue ibexa_product_specification * Update field type reference ToC * Update field type reference redirects * Continue ibexa_product_specification * field_type_reference.md: Fix Relation search * Apply vale suggestions * field_type_reference.md: Shorten some descriptions * urlfield.md: Link to External URL validation * Apply suggestions from code review Co-authored-by: Marek Nocoń <[email protected]> --------- Co-authored-by: Marek Nocoń <[email protected]>
1 parent 3d5c9ca commit 449a167

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+548
-650
lines changed

docs/content_management/field_types/field_type_reference/addressfield.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class ExampleAddressSubscriber implements EventSubscriberInterface
126126
'ibexa.address.field.tax_number.billing_address' => 'onBillingAddressTaxNumber',
127127
];
128128
}
129-
129+
130130
public function onBillingAddressTaxNumber(MapFieldEvent $event): void
131131
{
132132
$event->setLabel('VAT');

docs/content_management/field_types/field_type_reference/authorfield.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
This field type allows the storage and retrieval of one or more authors. For each author, it can handle a name and an email address. It's typically used to store information about additional authors who have written/created different parts of a content item.
44

5-
| Name | Internal name | Expected input | Output |
6-
|----------|---------------|----------------|----------|
7-
| `Author` | `ezauthor` | mixed | `string` |
5+
| Name | Internal name | Expected input | Output |
6+
|----------|----------------|----------------|----------|
7+
| `Author` | `ibexa_author` | mixed | `string` |
88

99
## PHP API field type
1010

1111
### Value object
1212

1313
##### Properties
1414

15-
|Attribute|Type|Description|Example|
16-
|------|------|------|------|
17-
|`authors`|`\Ibexa\Core\FieldType\Author\Author[] `|List of authors.|See below|
15+
| Attribute | Type | Description | Example |
16+
|-----------|------------------------------------------|------------------|-----------|
17+
| `authors` | `\Ibexa\Core\FieldType\Author\Author[] ` | List of authors. | See below |
1818

1919
Example:
2020

@@ -68,16 +68,16 @@ This field type doesn't perform any special validation of the input value.
6868

6969
The Field definition of this field type can be configured with a single option:
7070

71-
|Name|Type|Default value|Description|
72-
|------|------|------|------|
73-
|`defaultAuthor`|`mixed`|`Type::DEFAULT_VALUE_EMPTY`|One of the `DEFAULT_*` constants, used by the administration interface for setting the default Field value. See below for more details.|
71+
| Name | Type | Default value | Description |
72+
|-----------------|---------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
73+
| `defaultAuthor` | `mixed` | `Type::DEFAULT_VALUE_EMPTY` | One of the `DEFAULT_*` constants, used by the administration interface for setting the default Field value. See below for more details. |
7474

75-
Following `defaultAuthor` default value options are available as constants in the `Ibexa\Core\FieldType\Author\Type` class:
75+
Following `defaultAuthor` default value options are available as constants in the `Ibexa\Core\FieldType\Author\Type` class:
7676

77-
|Constant|Description|
78-
|------|------|
79-
|`DEFAULT_VALUE_EMPTY`|Default value is empty.|
80-
|`DEFAULT_CURRENT_USER`|Default value uses currently logged user.|
77+
| Constant | Description |
78+
|------------------------|-------------------------------------------|
79+
| `DEFAULT_VALUE_EMPTY` | Default value is empty. |
80+
| `DEFAULT_CURRENT_USER` | Default value uses currently logged user. |
8181

8282
``` php
8383
// Author field type example settings

docs/content_management/field_types/field_type_reference/binaryfilefield.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ This field type represents and handles a single binary file. It also counts the
55
It's capable of handling virtually any file type and is typically used for storing legacy document types, for example, PDF files, Word documents, or spreadsheets.
66
The maximum allowed file size is determined by the "Max file size" class attribute edit parameter and the `upload_max_filesize` directive in the main PHP configuration file (`php.ini`).
77

8-
| Name | Internal name | Expected input | Output |
9-
|--------------|----------------|----------------|---------|
10-
| `BinaryFile` | `ezbinaryfile` | mixed | mixed |
8+
| Name | Internal name | Expected input | Output |
9+
|--------------|--------------------|----------------|---------|
10+
| `BinaryFile` | `ibexa_binaryfile` | mixed | mixed |
1111

1212
## PHP API field type
1313

@@ -19,15 +19,15 @@ Both `BinaryFile` and `Media` Value and Type inherit from the `BinaryBase` abstr
1919

2020
`Ibexa\Core\FieldType\BinaryFile\Value` offers the following properties:
2121

22-
|Attribute|Type|Description|Example|
23-
|------|------|------|------|
24-
|`id`|string|Binary file identifier. This ID depends on the [IO Handler](clustering.md#dfs-io-handler) that is being used. With the native, default handlers (FileSystem and Legacy), the ID is the file path, relative to the binary file storage root dir (`var/<vardir>/storage/original` by default).|application/63cd472dd7.pdf|
25-
|`fileName`|string|The human-readable file name, as exposed to the outside. Used when sending the file for download to name the file.|20130116_whitepaper.pdf|
26-
|`fileSize`|int|File size, in bytes.|1077923|
27-
|`mimeType`|string|The file's MIME type.|application/pdf|
28-
|`uri`|string|The binary file's `content/download` URI. If the URI doesn't include a host or protocol, it applies to the request domain.|/content/download/210/2707|
29-
|`downloadCount`|integer|Number of times the file was downloaded|0|
30-
|`inputUri`|string|Path to a local file when creating a field value, `null` when reading a field value|`path/to/document.pdf`|
22+
| Attribute | Type | Description | Example |
23+
|-----------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|
24+
| `id` | string | Binary file identifier. This ID depends on the [IO Handler](clustering.md#dfs-io-handler) that is being used. With the native, default handlers (FileSystem and Legacy), the ID is the file path, relative to the binary file storage root dir (`var/<vardir>/storage/original` by default). | application/63cd472dd7.pdf |
25+
| `fileName` | string | The human-readable file name, as exposed to the outside. Used when sending the file for download to name the file. | 20130116_whitepaper.pdf |
26+
| `fileSize` | int | File size, in bytes. | 1077923 |
27+
| `mimeType` | string | The file's MIME type. | application/pdf |
28+
| `uri` | string | The binary file's `content/download` URI. If the URI doesn't include a host or protocol, it applies to the request domain. | /content/download/210/2707 |
29+
| `downloadCount` | integer | Number of times the file was downloaded | 0 |
30+
| `inputUri` | string | Path to a local file when creating a field value, `null` when reading a field value | `path/to/document.pdf` |
3131

3232
#### Constructor's hash format
3333

docs/content_management/field_types/field_type_reference/checkboxfield.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22

33
The Checkbox field type stores the current status for a checkbox input, checked or unchecked, by storing a boolean value.
44

5-
| Name | Internal name | Expected input type |
6-
|------------|---------------|---------------------|
7-
| `Checkbox` | `ezboolean` | `boolean` |
5+
| Name | Internal name | Expected input type |
6+
|------------|-----------------|---------------------|
7+
| `Checkbox` | `ibexa_boolean` | `boolean` |
88

9-
## PHP API field type 
9+
## PHP API field type
1010

1111
### Value object
1212

1313
##### Properties
1414

1515
The Value class of this field type contains the following properties:
1616

17-
| Property | Type | Default value | Description|
18-
|----------|-----------|---------------|------------|
17+
| Property | Type | Default value | Description |
18+
|----------|-----------|---------------|--------------------------------------------------------------------------------|
1919
| `$bool` | `boolean` | `false` | This property is used for the checkbox status, represented by a boolean value. |
2020

2121
``` php
2222
//Value object content examples
2323
use Ibexa\Core\FieldType\Checkbox\Type;
24-
 
24+
2525
// Instantiates a checkbox value with a default state (false)
2626
$checkboxValue = new Checkbox\Value();
27-
 
27+
2828
// Checked
2929
$value->bool = true;
3030

@@ -34,12 +34,12 @@ $value->bool = false;
3434

3535
##### Constructor
3636

37-
The `Checkbox\Value` constructor accepts a boolean value:
37+
The `Checkbox\Value` constructor accepts a boolean value:
3838

3939
``` php
4040
// Constructor example
4141
use Ibexa\Core\FieldType\Checkbox\Type;
42-
 
42+
4343
// Instantiates a checkbox value with a checked state
4444
$checkboxValue = new Checkbox\Value( true );
4545
```

docs/content_management/field_types/field_type_reference/contentqueryfield.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
This field type maps an executable repository query to a field.
44

5-
| Name | Internal name | Expected input |
6-
|-----------|---------------|----------------|
7-
| `Content query` | `ezcontentquery` | `string` |
5+
| Name | Internal name | Expected input |
6+
|---------|-----------------------|----------------|
7+
| `Query` | `ibexa_content_query` | `string` |
88

99
The Content query field type is available via the Query field type Bundle provided by the [fieldtype-query](https://github.com/ibexa/fieldtype-query) package.
1010

docs/content_management/field_types/field_type_reference/countryfield.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
This field type represents one or multiple countries.
44

5-
| Name | Internal name | Expected input |
6-
|-----------|---------------|----------------|
7-
| `Country` | `ezcountry` | `array` |
5+
| Name | Internal name | Expected input |
6+
|-----------|-----------------|----------------|
7+
| `Country` | `ibexa_country` | `array` |
88

9-
## PHP API field type 
9+
## PHP API field type
1010

1111
### Input expectations
1212

@@ -33,8 +33,8 @@ This field type validates whether multiple countries are allowed by the field de
3333

3434
The field definition of this field type can be configured with one option:
3535

36-
| Name | Type | Default value | Description|
37-
|--------------|-----------|---------------|------------|
36+
| Name | Type | Default value | Description |
37+
|--------------|-----------|---------------|--------------------------------------------------------------------------------------------|
3838
| `isMultiple` | `boolean` | `false` | This setting allows (if true) or prohibits (if false) the selection of multiple countries. |
3939

4040
``` php
@@ -62,8 +62,8 @@ The format used by the toHash method is the Alpha2 value, however the input is c
6262

6363
The Value class of this field type contains the following properties:
6464

65-
| Property | Type | Description|
66-
|--------------|-----------|------------|
65+
| Property | Type | Description |
66+
|--------------|-----------|---------------------------------------------------------------------------------------|
6767
| `$countries` | `array[]` | This property is used for the country selection provided as input, as its attributes. |
6868

6969
``` php
@@ -80,7 +80,7 @@ $value->countries = [
8080

8181
##### Constructor
8282

83-
The `Country\Value` constructor initializes a new value object with the value provided.
83+
The `Country\Value` constructor initializes a new value object with the value provided.
8484
It expects an array as input.
8585

8686
``` php

docs/content_management/field_types/field_type_reference/customergroupfield.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
This field type represents a customer group that a user belongs to.
44

5-
| Name | Internal name | Expected input type |
6-
|--------|---------------|---------------------|
7-
| `Customer group` | `ibexa_customer_group` | `int` or null |
5+
| Name | Internal name | Expected input type |
6+
|------------------|------------------------|---------------------|
7+
| `Customer group` | `ibexa_customer_group` | `int` or null |
88

99
## PHP API field type
1010

@@ -14,6 +14,6 @@ This field type represents a customer group that a user belongs to.
1414

1515
The Value class of this field type contains the following properties:
1616

17-
| Property | Type | Description|
18-
|----------|----------|------------|
19-
| `$id` | `int` | ID of the customer group. |
17+
| Property | Type | Description |
18+
|----------|---------|---------------------------|
19+
| `$id` | `int` | ID of the customer group. |

0 commit comments

Comments
 (0)