6
6
7
7
namespace Magento \Store \Model ;
8
8
9
+ use Magento \Framework \App \Config ;
9
10
use Magento \Framework \App \ObjectManager ;
10
11
use Magento \Framework \Exception \NoSuchEntityException ;
11
12
use Magento \Store \Model \ResourceModel \Website \CollectionFactory ;
12
- use Magento \Framework \App \Config ;
13
13
14
14
/**
15
15
* Information Expert in store websites handling
@@ -64,7 +64,7 @@ public function __construct(
64
64
}
65
65
66
66
/**
67
- * { @inheritdoc}
67
+ * @inheritdoc
68
68
*/
69
69
public function get ($ code )
70
70
{
@@ -78,15 +78,22 @@ public function get($code)
78
78
]);
79
79
80
80
if ($ website ->getId () === null ) {
81
- throw new NoSuchEntityException ();
81
+ throw new NoSuchEntityException (
82
+ __ (
83
+ sprintf (
84
+ "The website with code %s that was requested wasn't found. Verify the website and try again. " ,
85
+ $ code
86
+ )
87
+ )
88
+ );
82
89
}
83
90
$ this ->entities [$ code ] = $ website ;
84
91
$ this ->entitiesById [$ website ->getId ()] = $ website ;
85
92
return $ website ;
86
93
}
87
94
88
95
/**
89
- * { @inheritdoc}
96
+ * @inheritdoc
90
97
*/
91
98
public function getById ($ id )
92
99
{
@@ -100,15 +107,22 @@ public function getById($id)
100
107
]);
101
108
102
109
if ($ website ->getId () === null ) {
103
- throw new NoSuchEntityException ();
110
+ throw new NoSuchEntityException (
111
+ __ (
112
+ sprintf (
113
+ "The website with id %s that was requested wasn't found. Verify the website and try again. " ,
114
+ $ id
115
+ )
116
+ )
117
+ );
104
118
}
105
119
$ this ->entities [$ website ->getCode ()] = $ website ;
106
120
$ this ->entitiesById [$ id ] = $ website ;
107
121
return $ website ;
108
122
}
109
123
110
124
/**
111
- * { @inheritdoc}
125
+ * @inheritdoc
112
126
*/
113
127
public function getList ()
114
128
{
@@ -127,7 +141,7 @@ public function getList()
127
141
}
128
142
129
143
/**
130
- * { @inheritdoc}
144
+ * @inheritdoc
131
145
*/
132
146
public function getDefault ()
133
147
{
@@ -150,7 +164,7 @@ public function getDefault()
150
164
}
151
165
152
166
/**
153
- * { @inheritdoc}
167
+ * @inheritdoc
154
168
*/
155
169
public function clean ()
156
170
{
@@ -176,6 +190,7 @@ private function getAppConfig()
176
190
177
191
/**
178
192
* Initialize default website.
193
+ *
179
194
* @return void
180
195
*/
181
196
private function initDefaultWebsite ()
0 commit comments