S
S
Sergey Beloventsev2016-08-11 21:04:16
Yii
Sergey Beloventsev, 2016-08-11 21:04:16

Why is save() not working?

Actually here is the code

$trailers=Trailers::findOne(['id_film'=>$film->id]);
           if(isset($trailers)) {
                        $trailers->description = $video;
                        $trailers->id_film = $film->id;
                        if($trailers->save()){}else{var_dump($trailers->getErrors());};
             }

in the debugger shows that it finds such a record but does not save it. Why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2016-08-11
@Sergalas

Maybe beforeSave is overridden? it should return true.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question