components/DbManager.php
public function deleteAllItemsByUser($userId)
    {
        if (empty($userId)) {
            return [];
        }

        $command = \Yii::$app->getDb()->createCommand();
        $command->delete($this->assignmentTable, 'user_id = :user_id', ['user_id' => $userId]);
        return $command->execute();
    }
public function deleteAllItemsByUser($userId)
    {
        if (empty($userId)) {
            return [];
        }

        $command = \Yii::$app->getDb()->createCommand();
        $command->delete($this->assignmentTable, 'user_id = :user_id', ['user_id' => $userId]);
        return $command->execute();
    }
public function deleteAllItemsByUser ( $ userId ) { if ( empty ( $ userId ) ) { return [ ] ; } $ command = \ Yii :: $ app -> getDb ( ) -> createCommand ( ) ; $ command -> delete ( $ this -> assignmentTable , 'user_id = :user_id' , [ 'user_id' => $ userId ] ) ; return $ command -> execute ( ) ; }
Deleted roles and permissions assigned to user.

@param  integer $userId
@return array
Deleted roles and permissions assigned to user .