mautic / app /bundles /FormBundle /Collection /ObjectCollection.php
chrisbryan17's picture
Upload folder using huggingface_hub
d2897cd verified
raw
history blame contribute delete
526 Bytes
<?php
declare(strict_types=1);
namespace Mautic\FormBundle\Collection;
use Mautic\FormBundle\Crate\ObjectCrate;
/**
* @extends \ArrayIterator<int,ObjectCrate>
*/
final class ObjectCollection extends \ArrayIterator
{
/**
* @return array<string,string>
*/
public function toChoices(): array
{
$choices = [];
/** @var ObjectCrate $object */
foreach ($this as $object) {
$choices[$object->getName()] = $object->getKey();
}
return $choices;
}
}