Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ExampleAddressSubscriber implements EventSubscriberInterface
'ibexa.address.field.tax_number.billing_address' => 'onBillingAddressTaxNumber',
];
}

public function onBillingAddressTaxNumber(MapFieldEvent $event): void
{
$event->setLabel('VAT');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

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.

| Name | Internal name | Expected input | Output |
|----------|---------------|----------------|----------|
| `Author` | `ezauthor` | mixed | `string` |
| Name | Internal name | Expected input | Output |
|----------|----------------|----------------|----------|
| `Author` | `ibexa_author` | mixed | `string` |

## PHP API field type

### Value object

##### Properties

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

Example:

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

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

|Name|Type|Default value|Description|
|------|------|------|------|
|`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.|
| Name | Type | Default value | Description |
|-----------------|---------|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| `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. |

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

|Constant|Description|
|------|------|
|`DEFAULT_VALUE_EMPTY`|Default value is empty.|
|`DEFAULT_CURRENT_USER`|Default value uses currently logged user.|
| Constant | Description |
|------------------------|-------------------------------------------|
| `DEFAULT_VALUE_EMPTY` | Default value is empty. |
| `DEFAULT_CURRENT_USER` | Default value uses currently logged user. |

``` php
// Author field type example settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ This field type represents and handles a single binary file. It also counts the
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.
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`).

| Name | Internal name | Expected input | Output |
|--------------|----------------|----------------|---------|
| `BinaryFile` | `ezbinaryfile` | mixed | mixed |
| Name | Internal name | Expected input | Output |
|--------------|--------------------|----------------|---------|
| `BinaryFile` | `ibexa_binaryfile` | mixed | mixed |

## PHP API field type

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

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

|Attribute|Type|Description|Example|
|------|------|------|------|
|`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|
|`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|
|`fileSize`|int|File size, in bytes.|1077923|
|`mimeType`|string|The file's MIME type.|application/pdf|
|`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|
|`downloadCount`|integer|Number of times the file was downloaded|0|
|`inputUri`|string|Path to a local file when creating a field value, `null` when reading a field value|`path/to/document.pdf`|
| Attribute | Type | Description | Example |
|-----------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------|
| `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 |
| `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 |
| `fileSize` | int | File size, in bytes. | 1077923 |
| `mimeType` | string | The file's MIME type. | application/pdf |
| `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 |
| `downloadCount` | integer | Number of times the file was downloaded | 0 |
| `inputUri` | string | Path to a local file when creating a field value, `null` when reading a field value | `path/to/document.pdf` |

#### Constructor's hash format

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@

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

| Name | Internal name | Expected input type |
|------------|---------------|---------------------|
| `Checkbox` | `ezboolean` | `boolean` |
| Name | Internal name | Expected input type |
|------------|-----------------|---------------------|
| `Checkbox` | `ibexa_boolean` | `boolean` |

## PHP API field type 
## PHP API field type

### Value object

##### Properties

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

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

``` php
//Value object content examples
use Ibexa\Core\FieldType\Checkbox\Type;
 

// Instantiates a checkbox value with a default state (false)
$checkboxValue = new Checkbox\Value();
 

// Checked
$value->bool = true;

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

##### Constructor

The `Checkbox\Value` constructor accepts a boolean value:
The `Checkbox\Value` constructor accepts a boolean value:

``` php
// Constructor example
use Ibexa\Core\FieldType\Checkbox\Type;
 

// Instantiates a checkbox value with a checked state
$checkboxValue = new Checkbox\Value( true );
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

| Name | Internal name | Expected input |
|-----------|---------------|----------------|
| `Content query` | `ezcontentquery` | `string` |
| Name | Internal name | Expected input |
|---------|-----------------------|----------------|
| `Query` | `ibexa_content_query` | `string` |

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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This field type represents one or multiple countries.

| Name | Internal name | Expected input |
|-----------|---------------|----------------|
| `Country` | `ezcountry` | `array` |
| Name | Internal name | Expected input |
|-----------|-----------------|----------------|
| `Country` | `ibexa_country` | `array` |

## PHP API field type 
## PHP API field type

### Input expectations

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

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

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

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

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

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

``` php
Expand All @@ -80,7 +80,7 @@ $value->countries = [

##### Constructor

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

``` php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

| Name | Internal name | Expected input type |
|--------|---------------|---------------------|
| `Customer group` | `ibexa_customer_group` | `int` or null |
| Name | Internal name | Expected input type |
|------------------|------------------------|---------------------|
| `Customer group` | `ibexa_customer_group` | `int` or null |

## PHP API field type

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

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

| Property | Type | Description|
|----------|----------|------------|
| `$id` | `int` | ID of the customer group. |
| Property | Type | Description |
|----------|---------|---------------------------|
| `$id` | `int` | ID of the customer group. |
Loading
Loading