Reputation: 123
array_map() expects parameter 1 to be a valid callback, class 'Search' does not have a method 'wishList'
$shops = array_map(array($this, 'wishList'), $shops);
function wishList($shops) {
print_r(shops);
$this->check_authentication();
$user = $this->getUser();
$shops->isWishList = $this->Wishlist_model->_isShopInMyWishList($shops->id, $user->id,6) ? true : false;
return $shops;
}
Upvotes: 0
Views: 586
Reputation: 1108
For what I see that's the issue, you just declared your wishList
function not in the Search
class, if you wanna do this your should write this:
$shops = array_map('wishList', $shops);
Or move you wishList
function to your Search
class
Upvotes: 1