Skip to content
For AI agents: the complete documentation index is available at llms.txt; this page is also available as Markdown at index.md.

Author field type

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 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

Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
use Ibexa\Core\FieldType\Author;

$authorList = new Author\Value([
   new Author\Author([
       'id' => 1,
       'name' => 'Boba Fett',
       'email' => 'boba.fett@example.com',
   ]),
   new Author\Author([
       'id' => 2,
       'name' => 'Darth Vader',
       'email' => 'darth.vader@example.com',
   ]),
]);

Hash format

The hash format mostly matches the value object. It has the following key authors.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[
    [
       'id' => 1,
       'name' => 'Boba Fett',
       'email' => 'boba.fett@example.com',
    ],
    [
       'id' => 2,
       'name' => 'Darth Vader',
       'email' => 'darth.vader@example.com',
    ],
];

String representation

The string contains all the authors with their names and emails.

Example: John Doe john@doe.com

Validation

This field type doesn't perform any special validation of the input value.

Settings

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.

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.
1
2
3
4
5
6
7
// Author field type example settings

use Ibexa\Core\FieldType\Author\Type;

$settings = [
    'defaultAuthor' => Type::DEFAULT_VALUE_EMPTY,
];