public static function getVendorDisplayName($model) { if (is_null($model)) { return ''; } if ($model->vendor_name) { return $model->vendor_name; } return 'No vendor name'; }