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

The Checkbox Field Type

This field type represents a Checkbox status, checked or uncheck= ed.

Name Internal name Expected input type
Checkbox ezboolean boolean

Table of contents:

=20 =20

Description

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

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 an array of selected elements identifiers.

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<= /h3>

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.

 

------=_Part_3361_425175506.1485852819461--