Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UpdatedAtListProvider.php
Go to the documentation of this file.
1 <?php
7 
10 
17 {
21  private $resourceConnection;
22 
26  private $connection;
27 
31  public function __construct(ResourceConnection $resourceConnection)
32  {
33  $this->connection = $resourceConnection->getConnection('sales');
34  $this->resourceConnection = $resourceConnection;
35  }
36 
40  public function getIds($mainTableName, $gridTableName)
41  {
42  $mainTableName = $this->resourceConnection->getTableName($mainTableName);
43  $gridTableName = $this->resourceConnection->getTableName($gridTableName);
44  $select = $this->connection->select()
45  ->from($mainTableName, [$mainTableName . '.entity_id'])
46  ->joinInner(
47  [$gridTableName => $gridTableName],
48  sprintf(
49  '%s.entity_id = %s.entity_id AND %s.updated_at > %s.updated_at',
50  $mainTableName,
51  $gridTableName,
52  $mainTableName,
53  $gridTableName
54  ),
55  []
56  );
57 
58  return $this->connection->fetchAll($select, [], \Zend_Db::FETCH_COLUMN);
59  }
60 }
const FETCH_COLUMN
Definition: Db.php:147