common/models/base/ModelResource.php
public static function queryByParent( $parentId, $parentType, $config = [] ) {

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;

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

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

			return static::find()->where( 'parentId=:pid AND parentType=:ptype AND siteId=:siteId', [ ':pid' => $parentId, ':ptype' => $parentType, ':siteId' => $siteId ] );
		}
		else {

			return static::find()->where( 'parentId=:pid AND parentType=:ptype', [ ':pid' => $parentId, ':ptype' => $parentType ] );
		}
	}
public static function queryByParent( $parentId, $parentType, $config = [] ) {

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;

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

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

			return static::find()->where( 'parentId=:pid AND parentType=:ptype AND siteId=:siteId', [ ':pid' => $parentId, ':ptype' => $parentType, ':siteId' => $siteId ] );
		}
		else {

			return static::find()->where( 'parentId=:pid AND parentType=:ptype', [ ':pid' => $parentId, ':ptype' => $parentType ] );
		}
	}
public static function queryByParent ( $ parentId , $ parentType , $ config = [ ] ) { $ ignoreSite = isset ( $ config [ 'ignoreSite' ] ) ? $ config [ 'ignoreSite' ] : false ; if ( static :: isMultiSite ( ) && ! $ ignoreSite ) { $ siteId = isset ( $ config [ 'siteId' ] ) ? $ config [ 'siteId' ] : Yii :: $ app -> core -> siteId ; return static :: find ( ) -> where ( 'parentId=:pid AND parentType=:ptype AND siteId=:siteId' , [ ':pid' => $ parentId , ':ptype' => $ parentType , ':siteId' => $ siteId ] ) ; } else { return static :: find ( ) -> where ( 'parentId=:pid AND parentType=:ptype' , [ ':pid' => $ parentId , ':ptype' => $ parentType ] ) ; } }
Return query to find the models by given parent id and parent type.

@param integer $parentId
@param string $parentType
@param array $config
@return \yii\db\ActiveQuery to query by parent id and parent type.
Return query to find the models by given parent id and parent type .