Exemple #1
0
 /**
  * Prepare label using passed text as parameter.
  * If anchor text was not specified get entity name from DB.
  *
  * @return string
  */
 public function getLabel()
 {
     if (!$this->_anchorText) {
         if ($this->getData('anchor_text')) {
             $this->_anchorText = $this->getData('anchor_text');
         } elseif ($this->_entityResource) {
             $idPath = explode('/', $this->_getData('id_path'));
             if (isset($idPath[1])) {
                 $id = $idPath[1];
                 if ($id) {
                     $this->_anchorText = $this->_entityResource->getAttributeRawValue($id, 'name', $this->_storeManager->getStore());
                 }
             }
         }
     }
     return $this->_anchorText;
 }