Example #1
0
 public function testGetFlatUpdateSelect()
 {
     $store = 1;
     $select = 'select';
     $this->option->expects($this->once())->method('getFlatUpdateSelect')->with($this->attribute, $store, false)->will($this->returnValue($select));
     $this->assertEquals($select, $this->model->getFlatUpdateSelect($store));
 }
Example #2
0
 /**
  * Prepare option values of user defined attribute
  *
  * @param array|\Magento\Eav\Model\Resource\Entity\Attribute\Option $option
  * @param string $inputType
  * @param array $defaultValues
  * @return array
  */
 protected function _prepareUserDefinedAttributeOptionValues($option, $inputType, $defaultValues)
 {
     $optionId = $option->getId();
     $value['checked'] = in_array($optionId, $defaultValues) ? 'checked="checked"' : '';
     $value['intype'] = $inputType;
     $value['id'] = $optionId;
     $value['sort_order'] = $option->getSortOrder();
     foreach ($this->getStores() as $store) {
         $storeId = $store->getId();
         $storeValues = $this->getStoreOptionValues($storeId);
         $value['store' . $storeId] = isset($storeValues[$optionId]) ? $this->escapeHtml($storeValues[$optionId]) : '';
     }
     return [$value];
 }