Skip to content
Snippets Groups Projects
Commit 76758bb1 authored by damjan's avatar damjan
Browse files

[FEATURE] Utility class for conversions

parent babc062b
No related branches found
No related tags found
No related merge requests found
<?php
namespace SGalinski\TypoScriptReferenceFrontend\Utilities;
class Conversion {
/**
* The function converts array of attributes to associative array with form: [id => name]
*
* @param array $attributes
* @return array
*/
public static function toAssociativeIdNamesArray(array $attributes) {
$idsAndNames = [];
foreach ($attributes as $attribute) {
$idsAndNames[$attribute->id] = $attribute->name;
}
return $idsAndNames;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment