Message-ID: <1869350029.4110.1485857769932.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_4109_1635137130.1485857769932" ------=_Part_4109_1635137130.1485857769932 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Checkbox Field Type

Checkbox Field Type

=20
=20
=20
=20

This field type represents a Checkbox status, checked or unchecked.

Name Internal name Expected input type
Checkbox ezboolean boolean

Description

The Checkbox Field Type stores the current status for a checkbox input, = checked of unchecked, by storing a boolean value.

PHP API Field Type 

Value object

Properties

The Value class of this Field Type contains the following properties:

Property Type Default value Description
$bool boolean false This property will be used for the checkbox stat= us, which will be represented by a boolean value.
Value object content examples
=20
use eZ\Publish\Core\FieldType\Checkbox\Type;
 
// Instantiates a checkbox value with a default state (false)
$checkboxValue =3D new Checkbox\Value();
 
// Checked
$value->bool =3D true;=20
=20
// Unchecked
$value->bool =3D false;
=20
Constructor

The Checkbox\Value constructor acce= pts a boolean value:

Constructor example
=20
use eZ\Publish\Core\FieldType\Checkbox\Type;
 
// Instantiates a checkbox value with a checked state
$checkboxValue =3D new Checkbox\Value( true );
=20
String representation

As this Field Type is not a string but a bool, it will return "1" (true)= or "0" (false) in cases where it is cast to string.

 

=20
=20
=20
=20

 

=20
=20
=20
------=_Part_4109_1635137130.1485857769932--