/** * {@inheritdoc} */ public function dump(OutputInterface $output, HelperSet $helperSet) { $output->writeln("<info>Useable field filters...</info>"); $fields = ['id', 'created', 'updated', 'enabled', 'completeness', 'family.id', 'family.code', 'groups.id', 'groups.code', 'categories.id', 'categories.code']; $rows = []; foreach ($fields as $field) { $filter = $this->registry->getFieldFilter($field); if ($filter) { $class = get_class($filter); $operators = implode(', ', $filter->getOperators()); } else { $class = 'Not supported'; $operators = ''; } $rows[] = [$field, $class, $operators]; } $headers = ['field', 'filter_class', 'operators']; $table = $helperSet->get('table'); $table->setHeaders($headers)->setRows($rows); $table->render($output); }
/** * {@inheritdoc} */ public function dump(OutputInterface $output, HelperSet $helperSet) { $output->writeln("<info>Useable attributes filters...</info>"); $attributes = $this->repository->findAll(); $rows = []; foreach ($attributes as $attribute) { $field = $attribute->getCode(); $filter = $this->registry->getAttributeFilter($attribute); if ($filter) { $class = get_class($filter); $operators = implode(', ', $filter->getOperators()); } else { $class = 'Not supported'; $operators = ''; } $rows[] = [$field, $attribute->isLocalizable() ? 'yes' : 'no', $attribute->isScopable() ? 'yes' : 'no', $attribute->getAttributeType(), $class, $operators]; } $table = $helperSet->get('table'); $headers = ['attribute', 'localizable', 'scopable', 'attribute type', 'filter_class', 'operators']; $table->setHeaders($headers)->setRows($rows); $table->render($output); }