private static function buttonObjectFromArray($arr, $obj = null) { $jsonData = json_decode($arr['options'], true); if ($obj === null) { $obj = new SGMBButton(); } $obj->setTitle($arr['title']); $obj->setOptions($arr['options']); if (@$arr['id']) { $obj->setId($arr['id']); } return $obj; }