Welcome Guest, Not a member yet? Register   Sign In
array_column does not work with Entity
#1

(This post was last modified: 06-03-2024, 10:52 PM by warcooft.)

Hi everyone,
I have code like this:

PHP Code:
$notifications model(NotificationSettingModel::class)->withScheduleNotification()->find($userIds);

    if (empty($notifications)) {
         return false;
    }

$users model(UserModel::class)->find(array_column($notifications'user_id')); 


after running it, i got an error like this:
 
Code:
array_column(): Argument #1 ($array) must be of type array, App\Entities\NotificationSetting given


even though in version 4.4.8 the code above runs fine. but why doesn't it work on version 4.5.1?

i took an example from this repositori: 
https://github.com/lonnieezell/forum-exa...t.php#L121

Thanks All.
@xxxx[{::::::::::::::::::::::::::::::::>
Reply


Messages In This Thread
array_column does not work with Entity - by warcooft - 06-03-2024, 10:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB