Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ziaratban committed Dec 20, 2023
1 parent 2caf17b commit c154952
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/ActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ abstract class ActiveRecord extends BaseActiveRecord
* @var integer count of insert operation in queue
*/
private static $batchInsertQueue = [];
/*
* @var array array of document for insert
*/
private static $batchInsertDocuments = [];
/*
* @var int size of batch for insert operations
*/
Expand All @@ -51,10 +47,6 @@ abstract class ActiveRecord extends BaseActiveRecord
* @var integer count of update operation in queue
*/
private static $batchUpdateQueue = [];
/*
* @var array array of document for update
*/
private static $batchUpdateDocuments = [];
/*
* @var int size of batch for update operations
*/
Expand Down Expand Up @@ -533,8 +525,10 @@ public static function resetBatchInsert($scope = ''){
$className = static::className();
if(!@self::$batchInsertCommand[$className][$scope])
return;
self::$batchInsertQueue[$className][$scope] = 0;
self::$batchInsertCommand[$className][$scope]->document = [];
unset(
self::$batchInsertQueue[$className][$scope],
self::$batchInsertCommand[$className][$scope]
);
}

/**
Expand Down Expand Up @@ -625,8 +619,10 @@ public static function resetBatchUpdate($scope = ''){
$className = static::className();
if(!@self::$batchUpdateCommand[$className][$scope])
return;
self::$batchUpdateQueue[$className][$scope] = 0;
self::$batchUpdateCommand[$className][$scope]->document = [];
unset(
self::$batchUpdateQueue[$className][$scope],
self::$batchUpdateCommand[$className][$scope]
);
}

/**
Expand Down Expand Up @@ -710,8 +706,10 @@ public static function resetBatchDelete($scope = ''){
$className = static::className();
if(!@self::$batchDeleteCommand[$className][$scope])
return;
self::$batchDeleteQueue[$className][$scope] = 0;
self::$batchDeleteCommand[$className][$scope]->document = [];
unset(
self::$batchDeleteQueue[$className][$scope],
self::$batchDeleteCommand[$className][$scope]
);
}

/**
Expand Down

0 comments on commit c154952

Please sign in to comment.