Skip to content

Commit 50d4919

Browse files
committed
MAGETWO-65420: Update reports definitions for the Advanced Reporting service
1 parent 135dd2f commit 50d4919

File tree

10 files changed

+38
-34
lines changed

10 files changed

+38
-34
lines changed

app/code/Magento/Analytics/ReportXml/DB/ConditionResolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Magento\Analytics\ReportXml\DB;
88

99
use Magento\Framework\App\ResourceConnection;
10-
use Magento\Framework\DB\Sql\MagentoDbExpression;
10+
use Magento\Framework\DB\Sql\Expression;
1111

1212
/**
1313
* Class ConditionResolver
@@ -88,7 +88,7 @@ private function getValue($condition, $referencedEntity)
8888
$value = $this->getConnection()->quote($argument);
8989
break;
9090
case "variable":
91-
$value = new MagentoDbExpression($argument);
91+
$value = new Expression($argument);
9292
break;
9393
case "identifier":
9494
$value = $this->getConnection()->quoteIdentifier(
@@ -112,7 +112,7 @@ private function getCondition(SelectBuilder $selectBuilder, $tableName, $conditi
112112
{
113113
$columns = $selectBuilder->getColumns();
114114
if (isset($columns[$condition['attribute']])
115-
&& $columns[$condition['attribute']] instanceof MagentoDbExpression
115+
&& $columns[$condition['attribute']] instanceof Expression
116116
) {
117117
$expression = $columns[$condition['attribute']];
118118
} else {

app/code/Magento/Analytics/Test/Unit/ReportXml/DB/ConditionResolverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Framework\App\ResourceConnection;
1010
use Magento\Analytics\ReportXml\DB\SelectBuilder;
1111
use Magento\Framework\DB\Adapter\AdapterInterface;
12-
use Magento\Framework\DB\Sql\MagentoDbExpression;
12+
use Magento\Framework\DB\Sql\Expression;
1313

1414
/**
1515
* Class ConditionResolverTest
@@ -81,7 +81,7 @@ public function testGetFilter()
8181

8282
$this->selectBuilderMock->expects($this->any())
8383
->method('getColumns')
84-
->willReturn(['price' => new MagentoDbExpression("(n.price = 400)")]);
84+
->willReturn(['price' => new Expression("(n.price = 400)")]);
8585

8686
$this->resourceConnectionMock->expects($this->once())
8787
->method('getConnection')

lib/internal/Magento/Framework/DB/Sql/ColumnValueExpression.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
/**
99
* Class Column Value Expression
1010
*
11-
* Just a wrapper over MagentoDbExpression for implementing the specific type of expression.
11+
* Just a wrapper over Expression for implementing the specific type of expression.
1212
* @api
1313
*/
14-
class ColumnValueExpression extends MagentoDbExpression
14+
class ColumnValueExpression extends Expression
1515
{
1616
}

lib/internal/Magento/Framework/DB/Sql/ConcatExpression.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* Class Concat
1313
*/
14-
class ConcatExpression extends MagentoDbExpression
14+
class ConcatExpression extends Expression
1515
{
1616
/**
1717
* @var AdapterInterface

lib/internal/Magento/Framework/DB/Sql/MagentoDbExpression.php renamed to lib/internal/Magento/Framework/DB/Sql/Expression.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
*/
66
namespace Magento\Framework\DB\Sql;
77

8+
use Zend\Stdlib\JsonSerializable;
9+
810
/**
911
* Class is wrapper over Zend_Db_Expr for implement JsonSerializable interface.
1012
*/
11-
class MagentoDbExpression extends \Zend_Db_Expr implements MagentoDbExpressionInterface
13+
class Expression extends \Zend_Db_Expr implements ExpressionInterface, JsonSerializable
1214
{
1315
/**
1416
* @inheritdoc
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Framework\DB\Sql;
7+
8+
/**
9+
* Interface ExpressionInterface
10+
*
11+
* Defines interface was implemented in Zend_Db_Expr.
12+
* Interface for SQL Expressions for DB Adapter/Select.
13+
* By using this interface a developer can strictly control type for code that manages an Expression directly.
14+
*/
15+
interface ExpressionInterface
16+
{
17+
/**
18+
* @return string The string of the SQL expression stored in this object.
19+
*/
20+
public function __toString();
21+
}

lib/internal/Magento/Framework/DB/Sql/LimitExpression.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* Class LimitExpression
1010
*/
11-
class LimitExpression extends MagentoDbExpression
11+
class LimitExpression extends Expression
1212
{
1313
/**
1414
* @var string

lib/internal/Magento/Framework/DB/Sql/LookupExpression.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
/**
1313
* Class LookupExpression
1414
*/
15-
class LookupExpression extends MagentoDbExpression
15+
class LookupExpression extends Expression
1616
{
17-
1817
/**
1918
* @var Resource
2019
*/

lib/internal/Magento/Framework/DB/Sql/MagentoDbExpressionInterface.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

lib/internal/Magento/Framework/DB/Sql/UnionExpression.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
use Magento\Framework\DB\Select;
99

10-
class UnionExpression extends MagentoDbExpression
10+
/**
11+
* Class UnionExpression
12+
*/
13+
class UnionExpression extends Expression
1114
{
1215
/**
1316
* @var Select[]

0 commit comments

Comments
 (0)