mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 06:11:06 +03:30
add validation for enabled labels, rename enable (to enabled) in labels table, and update the enabled attribute of corresponding labels to false when cycle saved
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
if (!function_exists('pluckValues')) {
|
||||
/**
|
||||
* Extracts the values of a given key from an array of associative arrays.
|
||||
*
|
||||
* @param array $array The input array of associative arrays.
|
||||
* @param string $key The key whose values need to be extracted.
|
||||
* @return array An array containing the values of the specified key.
|
||||
*/
|
||||
function pluckValues(array $array, string $key): array
|
||||
{
|
||||
return array_map(function ($item) use ($key) {
|
||||
return $item[$key] ?? null;
|
||||
}, $array);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user