DiverseYouthNightSchool/application/admin/command/Crud/stubs/mixins/multiple.stub

8 lines
284 B
Plaintext

public function {%methodName%}($value, $data)
{
$value = $value ?: ($data['{%field%}'] ?? '');
$valueArr = explode(',', $value);
$list = $this->{%listMethodName%}();
return implode(',', array_intersect_key($list, array_flip($valueArr)));
}