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);
    }
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);
    }
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 ) ; }
Helper method for array search to locate the property with the given property

@param $needle
@param $haystack
@param $property

@return false|int|string
Helper method for array search to locate the property with the given property