common/models/resources/ModelComment.php
public static function findByUser( $parentId, $parentType, $userId, $type = ModelComment::TYPE_COMMENT ) {

		return static::find()->where( 'parentId=:pid AND parentType=:ptype AND createdBy=:uid AND type=:type', [ ':pid' => $parentId, ':ptype' => $parentType, ':uid' => $userId, ':type' => $type ] )->one();
	}
public static function findByUser( $parentId, $parentType, $userId, $type = ModelComment::TYPE_COMMENT ) {

		return static::find()->where( 'parentId=:pid AND parentType=:ptype AND createdBy=:uid AND type=:type', [ ':pid' => $parentId, ':ptype' => $parentType, ':uid' => $userId, ':type' => $type ] )->one();
	}
public static function findByUser ( $ parentId , $ parentType , $ userId , $ type = ModelComment :: TYPE_COMMENT ) { return static :: find ( ) -> where ( 'parentId=:pid AND parentType=:ptype AND createdBy=:uid AND type=:type' , [ ':pid' => $ parentId , ':ptype' => $ parentType , ':uid' => $ userId , ':type' => $ type ] ) -> one ( ) ; }
Find and return the comment for given user id.

@param integer $parentId
@param string $parentType
@param integer $userId
@param string $type
@return ModelComment
Find and return the comment for given user id .