RSS Feed/News Undefined method 'array_map'

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
23,632
Points
823

Reputation:

I'm getting error "undefined method array_map" in my function.
Should I import some class in order to work? Or any special xf tag to loop in query results?

PHP
Code:

Code:
public function actionExpire()
    {
        $books = $this->finder('FOX\Books:Book')->where('status', 'valid')->fetch();
        $books->array_map(
            function($book) {
                if ($book->expiration < time())
                {
                    $book->status = 'expired';
                    $book->save()...

Read more

Continue reading...
 
Status
Not open for further replies.
Top