Exemplo n.º 1
0
 /**
  * @param int $isSearchableInGrid
  * @param string $frontendInput
  * @param bool $result
  * @dataProvider dataProviderCanBeSearchableInGrid
  */
 public function testCanBeSearchableInGrid($isSearchableInGrid, $frontendInput, $result)
 {
     $this->attribute->setData('is_searchable_in_grid', $isSearchableInGrid);
     $this->attribute->setData(AttributeInterface::FRONTEND_INPUT, $frontendInput);
     $this->assertEquals($result, $this->attribute->canBeSearchableInGrid());
 }
 /**
  * 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;
 }