protected function arraySearch($needle, $haystack, $property)
    {
        return array_search($needle, array_map(function ($value) use ($property) {
            return \is_object($value) ? $value->$property : $value[$property];
        }, $haystack), true);
    }