Criteria,Active data provider, CDbCriteria in Yii 2

I’m trying to transfer this code below part to yii2. it works for Yii 1 at controller but i ve read that i don’t need criteria in Yii2 as it is not exist anymore. Can one show me how to run it in yii2? And also is CDBCriteria used better as ActiveQuery or Query in yii2?

public function search()


        $criteria=new CDbCriteria;














        return new CActiveDataProvider($this, array(




    public static function model($className=__CLASS__)


        return parent::model($className);


    public function getInCalls($fromDate = false, $toDate = false) {

        $rawData = Yii::$app->db->createCommand ( "select id, date as Date, ch as Channel, dir as Direction, ourl as Twinkle, imob as IncomingCall, state as State from logs where tAnswer like '%+%' group by date order by date desc" )->queryAll ();

        return $rawData; 

Take some time to create a simple pet project with Yii 2 and play with the Gii’s CRUD generator, then you’ll find what ‘search()’ method looks like in Yii 2. :)