Esempio n. 1
0
 /**
  * @param int $isFilterableInGrid
  * @param string $frontendInput
  * @param bool $result
  * @dataProvider dataProviderCanBeFilterableInGrid
  */
 public function testCanBeFilterableInGrid($isFilterableInGrid, $frontendInput, $result)
 {
     $this->attribute->setData('is_filterable_in_grid', $isFilterableInGrid);
     $this->attribute->setData(AttributeInterface::FRONTEND_INPUT, $frontendInput);
     $this->assertEquals($result, $this->attribute->canBeFilterableInGrid());
 }
 /**
  * Get field type for attribute
  *
  * @param Attribute $attribute
  * @return string
  */
 protected function getType(Attribute $attribute)
 {
     if ($attribute->canBeSearchableInGrid()) {
         $type = 'searchable';
     } elseif ($attribute->canBeFilterableInGrid()) {
         $type = 'filterable';
     } else {
         $type = 'virtual';
     }
     return $type;
 }