common/models/resources/Category.php
public static function findFeaturedByType( $type, $config = [] ) {

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;
		$order		= isset( $config[ 'order' ] ) ? $config[ 'order' ] : [ 'name' => SORT_ASC  ];
		$limit 		= $config['limit'] ?? null;

		if( static::isMultiSite() && !$ignoreSite ) {

			$siteId	= isset( $config[ 'siteId' ] ) ? $config[ 'siteId' ] : Yii::$app->core->siteId;

			return static::find()->where( 'type=:type AND siteId=:siteId AND featured=1', [ ':type' => $type, ':siteId' => $siteId ] )->orderBy( $order )->limit($limit)->all();
		}
		else {

			return static::find()->where( 'type=:type AND featured=1', [ ':type' => $type ] )->orderBy( $order )->limit( $limit )->all();
		}
	}
public static function findFeaturedByType( $type, $config = [] ) {

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;
		$order		= isset( $config[ 'order' ] ) ? $config[ 'order' ] : [ 'name' => SORT_ASC  ];
		$limit 		= $config['limit'] ?? null;

		if( static::isMultiSite() && !$ignoreSite ) {

			$siteId	= isset( $config[ 'siteId' ] ) ? $config[ 'siteId' ] : Yii::$app->core->siteId;

			return static::find()->where( 'type=:type AND siteId=:siteId AND featured=1', [ ':type' => $type, ':siteId' => $siteId ] )->orderBy( $order )->limit($limit)->all();
		}
		else {

			return static::find()->where( 'type=:type AND featured=1', [ ':type' => $type ] )->orderBy( $order )->limit( $limit )->all();
		}
	}
public static function findFeaturedByType ( $ type , $ config = [ ] ) { $ ignoreSite = isset ( $ config [ 'ignoreSite' ] ) ? $ config [ 'ignoreSite' ] : false ; $ order = isset ( $ config [ 'order' ] ) ? $ config [ 'order' ] : [ 'name' => SORT_ASC ] ; $ limit = $ config [ 'limit' ] ?? null ; if ( static :: isMultiSite ( ) && ! $ ignoreSite ) { $ siteId = isset ( $ config [ 'siteId' ] ) ? $ config [ 'siteId' ] : Yii :: $ app -> core -> siteId ; return static :: find ( ) -> where ( 'type=:type AND siteId=:siteId AND featured=1' , [ ':type' => $ type , ':siteId' => $ siteId ] ) -> orderBy ( $ order ) -> limit ( $ limit ) -> all ( ) ; } else { return static :: find ( ) -> where ( 'type=:type AND featured=1' , [ ':type' => $ type ] ) -> orderBy ( $ order ) -> limit ( $ limit ) -> all ( ) ; } }
Find and return the featured categories for given type.

@param string $type
@param array $config
@return Category
Find and return the featured categories for given type .