File tree Expand file tree Collapse file tree 9 files changed +9
-23
lines changed
app/code/Magento/Sales/Model
lib/internal/Magento/Framework/ObjectManager/Code/Generator Expand file tree Collapse file tree 9 files changed +9
-23
lines changed Original file line number Diff line number Diff line change @@ -60,10 +60,7 @@ public function get($id)
60
60
61
61
if (!isset ($ this ->registry [$ id ])) {
62
62
/** @var \Magento\Sales\Api\Data\OrderAddressInterface $entity */
63
- $ entity = $ this ->metadata ->getNewInstance ();
64
-
65
- $ this ->metadata ->getMapper ()->load ($ entity , $ id );
66
-
63
+ $ entity = $ this ->metadata ->getNewInstance ()->load ($ id );
67
64
if (!$ entity ->getEntityId ()) {
68
65
throw new NoSuchEntityException (__ ('Requested entity doesn \'t exist ' ));
69
66
}
Original file line number Diff line number Diff line change @@ -64,8 +64,7 @@ public function get($id)
64
64
}
65
65
if (!isset ($ this ->registry [$ id ])) {
66
66
/** @var \Magento\Sales\Api\Data\CreditmemoInterface $entity */
67
- $ entity = $ this ->metadata ->getNewInstance ();
68
- $ this ->metadata ->getMapper ()->load ($ entity , $ id );
67
+ $ entity = $ this ->metadata ->getNewInstance ()->load ($ id );
69
68
if (!$ entity ->getEntityId ()) {
70
69
throw new NoSuchEntityException (__ ('Requested entity doesn \'t exist ' ));
71
70
}
Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ public function get($id)
62
62
}
63
63
if (!isset ($ this ->registry [$ id ])) {
64
64
/** @var \Magento\Sales\Api\Data\InvoiceInterface $entity */
65
- $ entity = $ this ->metadata ->getNewInstance ();
66
- $ this ->metadata ->getMapper ()->load ($ entity , $ id );
65
+ $ entity = $ this ->metadata ->getNewInstance ()->load ($ id );
67
66
if (!$ entity ->getEntityId ()) {
68
67
throw new NoSuchEntityException (__ ('Requested entity doesn \'t exist ' ));
69
68
}
Original file line number Diff line number Diff line change @@ -99,8 +99,7 @@ public function get($id)
99
99
}
100
100
if (!isset ($ this ->registry [$ id ])) {
101
101
/** @var OrderItemInterface $orderItem */
102
- $ orderItem = $ this ->metadata ->getNewInstance ();
103
- $ this ->metadata ->getMapper ()->load ($ orderItem , $ id );
102
+ $ orderItem = $ this ->metadata ->getNewInstance ()->load ($ id );
104
103
if (!$ orderItem ->getItemId ()) {
105
104
throw new NoSuchEntityException (__ ('Requested entity doesn \'t exist ' ));
106
105
}
Original file line number Diff line number Diff line change @@ -79,8 +79,7 @@ public function get($id)
79
79
throw new \Magento \Framework \Exception \InputException (__ ('ID required ' ));
80
80
}
81
81
if (!isset ($ this ->registry [$ id ])) {
82
- $ entity = $ this ->metaData ->getNewInstance ();
83
- $ this ->metaData ->getMapper ()->load ($ entity , $ id );
82
+ $ entity = $ this ->metaData ->getNewInstance ()->load ($ id );
84
83
if (!$ entity ->getId ()) {
85
84
throw new NoSuchEntityException (__ ('Requested entity doesn \'t exist ' ));
86
85
}
Original file line number Diff line number Diff line change @@ -95,9 +95,7 @@ public function get($id)
95
95
throw new \Magento \Framework \Exception \InputException (__ ('ID required ' ));
96
96
}
97
97
if (!$ this ->entityStorage ->has ($ id )) {
98
- $ entity = $ this ->metaData ->getNewInstance ();
99
- /** @var \Magento\Sales\Api\Data\TransactionInterface $entity */
100
- $ this ->metaData ->getMapper ()->load ($ entity , $ id );
98
+ $ entity = $ this ->metaData ->getNewInstance ()->load ($ id );
101
99
if (!$ entity ->getTransactionId ()) {
102
100
throw new NoSuchEntityException (__ ('Requested entity doesn \'t exist ' ));
103
101
}
Original file line number Diff line number Diff line change @@ -60,10 +60,7 @@ public function get($id)
60
60
61
61
if (!isset ($ this ->registry [$ id ])) {
62
62
/** @var \Magento\Sales\Api\Data\ShipmentInterface $entity */
63
- $ entity = $ this ->metadata ->getNewInstance ();
64
-
65
- $ this ->metadata ->getMapper ()->load ($ entity , $ id );
66
-
63
+ $ entity = $ this ->metadata ->getNewInstance ()->load ($ id );
67
64
if (!$ entity ->getEntityId ()) {
68
65
throw new NoSuchEntityException (__ ('Requested entity doesn \'t exist ' ));
69
66
}
Original file line number Diff line number Diff line change @@ -60,8 +60,7 @@ public function get($id)
60
60
}
61
61
if (!isset ($ this ->registry [$ id ])) {
62
62
/** @var \Magento\Sales\Api\Data\OrderInterface $entity */
63
- $ entity = $ this ->metadata ->getNewInstance ();
64
- $ this ->metadata ->getMapper ()->load ($ entity , $ id );
63
+ $ entity = $ this ->metadata ->getNewInstance ()->load ($ id );
65
64
if (!$ entity ->getEntityId ()) {
66
65
throw new NoSuchEntityException (__ ('Requested entity doesn \'t exist ' ));
67
66
}
Original file line number Diff line number Diff line change @@ -249,8 +249,7 @@ protected function _getGetConnectionMethod()
249
249
*/
250
250
protected function _getLoadEntityMethod ()
251
251
{
252
- $ body = "\$entity = \$this-> {$ this ->_getSourceFactoryPropertyName ()}->create(); \n"
253
- . "\$this-> {$ this ->_getSourceResourcePropertyName ()}->load( \$entity, \$key); \n"
252
+ $ body = "\$entity = \$this-> {$ this ->_getSourceFactoryPropertyName ()}->create()->load( \$key); \n"
254
253
. "return \$entity; " ;
255
254
return [
256
255
'name ' => 'loadEntity ' ,
You can’t perform that action at this time.
0 commit comments