@@ -844,7 +844,7 @@ public static function insertPollRequest(Poll $poll)
844844
845845 $ sth ->bindValue (':id ' , $ poll ->getId ());
846846 $ sth ->bindValue (':question ' , $ poll ->getQuestion ());
847- $ sth ->bindValue (':options ' , self ::entitiesArrayToJson ($ poll ->getOptions ()));
847+ $ sth ->bindValue (':options ' , self ::entitiesArrayToJson ($ poll ->getOptions () ?: null ));
848848 $ sth ->bindValue (':is_closed ' , $ poll ->getIsClosed ());
849849 $ sth ->bindValue (':created_at ' , self ::getTimestamp ());
850850
@@ -976,13 +976,13 @@ public static function insertMessageRequest(Message $message)
976976 $ sth ->bindValue (':media_group_id ' , $ message ->getMediaGroupId ());
977977 $ sth ->bindValue (':author_signature ' , $ message ->getAuthorSignature ());
978978 $ sth ->bindValue (':text ' , $ message ->getText ());
979- $ sth ->bindValue (':entities ' , self ::entitiesArrayToJson ($ message ->getEntities ()));
980- $ sth ->bindValue (':caption_entities ' , self ::entitiesArrayToJson ($ message ->getCaptionEntities ()));
979+ $ sth ->bindValue (':entities ' , self ::entitiesArrayToJson ($ message ->getEntities () ?: null ));
980+ $ sth ->bindValue (':caption_entities ' , self ::entitiesArrayToJson ($ message ->getCaptionEntities () ?: null ));
981981 $ sth ->bindValue (':audio ' , $ message ->getAudio ());
982982 $ sth ->bindValue (':document ' , $ message ->getDocument ());
983983 $ sth ->bindValue (':animation ' , $ message ->getAnimation ());
984984 $ sth ->bindValue (':game ' , $ message ->getGame ());
985- $ sth ->bindValue (':photo ' , self ::entitiesArrayToJson ($ message ->getPhoto ()));
985+ $ sth ->bindValue (':photo ' , self ::entitiesArrayToJson ($ message ->getPhoto () ?: null ));
986986 $ sth ->bindValue (':sticker ' , $ message ->getSticker ());
987987 $ sth ->bindValue (':video ' , $ message ->getVideo ());
988988 $ sth ->bindValue (':voice ' , $ message ->getVoice ());
@@ -995,7 +995,7 @@ public static function insertMessageRequest(Message $message)
995995 $ sth ->bindValue (':new_chat_members ' , $ new_chat_members_ids );
996996 $ sth ->bindValue (':left_chat_member ' , $ left_chat_member_id );
997997 $ sth ->bindValue (':new_chat_title ' , $ message ->getNewChatTitle ());
998- $ sth ->bindValue (':new_chat_photo ' , self ::entitiesArrayToJson ($ message ->getNewChatPhoto ()));
998+ $ sth ->bindValue (':new_chat_photo ' , self ::entitiesArrayToJson ($ message ->getNewChatPhoto () ?: null ));
999999 $ sth ->bindValue (':delete_chat_photo ' , $ message ->getDeleteChatPhoto ());
10001000 $ sth ->bindValue (':group_chat_created ' , $ message ->getGroupChatCreated ());
10011001 $ sth ->bindValue (':supergroup_chat_created ' , $ message ->getSupergroupChatCreated ());
@@ -1058,7 +1058,7 @@ public static function insertEditedMessageRequest(Message $edited_message)
10581058 $ sth ->bindValue (':user_id ' , $ user_id );
10591059 $ sth ->bindValue (':edit_date ' , $ edit_date );
10601060 $ sth ->bindValue (':text ' , $ edited_message ->getText ());
1061- $ sth ->bindValue (':entities ' , self ::entitiesArrayToJson ($ edited_message ->getEntities ()));
1061+ $ sth ->bindValue (':entities ' , self ::entitiesArrayToJson ($ edited_message ->getEntities () ?: null ));
10621062 $ sth ->bindValue (':caption ' , $ edited_message ->getCaption ());
10631063
10641064 return $ sth ->execute ();
0 commit comments