mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
- Form SDK implementation - Basic Forms - Dynamics Forms - Basic Blocks + Data Model Block - Form Compilation - Turbo integration
30 lines
562 B
PHP
30 lines
562 B
PHP
<?php
|
|
|
|
/*
|
|
* @copyright Copyright (C) 2010-2025 Combodo SARL
|
|
* @license http://opensource.org/licenses/AGPL-3.0
|
|
*/
|
|
|
|
namespace Combodo\iTop\Forms\IO\Converter;
|
|
|
|
use Combodo\iTop\Forms\IO\Format\IntegerIOFormat;
|
|
|
|
/**
|
|
* Count elements in a collection.
|
|
*
|
|
* @package Combodo\iTop\Forms\IO\Converter
|
|
* @since 3.3.0
|
|
*/
|
|
class CollectionToCountConverter extends AbstractConverter
|
|
{
|
|
/** @inheritdoc */
|
|
public function Convert(mixed $oData): ?IntegerIOFormat
|
|
{
|
|
if ($oData === null) {
|
|
return null;
|
|
}
|
|
|
|
return new IntegerIOFormat(count($oData));
|
|
}
|
|
}
|