Skip to content

Commit 7e4c8e0

Browse files
committed
ACP2E-3247: sales_clean_quotes cron deletes quotes from to yet approved purchase orders
1 parent 71432ae commit 7e4c8e0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

app/code/Magento/Quote/Model/ResourceModel/Quote/Collection.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,29 @@ protected function _construct()
2121
{
2222
$this->_init(\Magento\Quote\Model\Quote::class, \Magento\Quote\Model\ResourceModel\Quote::class);
2323
}
24+
25+
/**
26+
* Join table to collection select
27+
*
28+
* @param array|string $table
29+
* @param string $cond
30+
* @param array|string $cols
31+
* @return $this
32+
*/
33+
public function joinLeft(array|string $table, string $cond, array|string $cols = '*')
34+
{
35+
if (is_array($table)) {
36+
$newTable = reset($table);
37+
$alias = key($table);
38+
$table = $newTable;
39+
} else {
40+
$alias = $table;
41+
}
42+
43+
if (!isset($this->_joinedTables[$alias])) {
44+
$this->getSelect()->joinLeft([$alias => $this->getTable($table)], $cond, $cols);
45+
$this->_joinedTables[$alias] = true;
46+
}
47+
return $this;
48+
}
2449
}

0 commit comments

Comments
 (0)