Error doing db query in component

When I put a simple query in my component it crashes.


public $newsItems = NewsItems::model()->findAll();

What am I doing wrong? I need to pass the query results to the component view to be displayed in the header.

Nevermind, I got it…