The producers of The Lego Movie partnered with Lego in order to produce the feature film. Lego’s main concern was not to endorse the movie as a huge, 90-minutes commercial. Among the restrictions imposed by the brand was lego characters not kissing. Lego was involved in the production as a specialist, by helping design characters. The Fast Company, who published a story about it, doesn’t give any financial details about the partnership.
And here’s The Lego Movie trailer: