6
6
7
7
namespace Magento \Eav \Model \Entity \Attribute ;
8
8
9
- use Magento \Eav \Exception as EavException ;
9
+ use Magento \Framework \Exception \ LocalizedException ;
10
10
use Magento \Framework \Api \AttributeValueFactory ;
11
11
12
12
/**
@@ -181,7 +181,7 @@ protected function _construct()
181
181
* @param string|int|\Magento\Eav\Model\Entity\Type $entityType
182
182
* @param string $code
183
183
* @return $this
184
- * @throws EavException
184
+ * @throws LocalizedException
185
185
*/
186
186
public function loadByCode ($ entityType , $ code )
187
187
{
@@ -195,7 +195,7 @@ public function loadByCode($entityType, $code)
195
195
$ entityTypeId = $ entityType ->getId ();
196
196
}
197
197
if (empty ($ entityTypeId )) {
198
- throw new EavException (__ ('Invalid entity supplied ' ));
198
+ throw new LocalizedException (__ ('Invalid entity supplied ' ));
199
199
}
200
200
$ this ->_getResource ()->loadByCode ($ this , $ entityTypeId , $ code );
201
201
$ this ->_afterLoad ();
@@ -461,7 +461,7 @@ public function getEntityIdField()
461
461
* Retrieve backend instance
462
462
*
463
463
* @return \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
464
- * @throws EavException
464
+ * @throws LocalizedException
465
465
*/
466
466
public function getBackend ()
467
467
{
@@ -471,7 +471,7 @@ public function getBackend()
471
471
}
472
472
$ backend = $ this ->_universalFactory ->create ($ this ->getBackendModel ());
473
473
if (!$ backend ) {
474
- throw new EavException (__ ('Invalid backend model specified: ' . $ this ->getBackendModel ()));
474
+ throw new LocalizedException (__ ('Invalid backend model specified: ' . $ this ->getBackendModel ()));
475
475
}
476
476
$ this ->_backend = $ backend ->setAttribute ($ this );
477
477
}
@@ -500,7 +500,7 @@ public function getFrontend()
500
500
* Retrieve source instance
501
501
*
502
502
* @return \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
503
- * @throws EavException
503
+ * @throws LocalizedException
504
504
*/
505
505
public function getSource ()
506
506
{
@@ -510,7 +510,7 @@ public function getSource()
510
510
}
511
511
$ source = $ this ->_universalFactory ->create ($ this ->getSourceModel ());
512
512
if (!$ source ) {
513
- throw new EavException (
513
+ throw new LocalizedException (
514
514
__ (
515
515
'Source model "%1" not found for attribute "%2" ' ,
516
516
$ this ->getSourceModel (),
0 commit comments