mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-22 00:32:16 +02:00
N°8772 - Form dependencies manager implementation
- Form SDK implementation - Basic Forms - Dynamics Forms - Basic Blocks + Data Model Block - Form Compilation - Turbo integration
This commit is contained in:
29
sources/Forms/IO/Converter/CollectionToCountConverter.php
Normal file
29
sources/Forms/IO/Converter/CollectionToCountConverter.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user