/** * {@inheritdoc} */ public function isThereProduct(ProductInterface $product) { if (!($table = $this->getDocument()->find('css', 'table'))) { return false; } $row = $this->tableManipulator->getRowWithFields($table, ['id' => $product->getId()]); return null === $row; }
/** * {@inheritdoc} */ public function isResourceOnPage(array $parameters) { try { $rows = $this->tableManipulator->getRowsWithFields($this->getElement('table'), $parameters); return 1 === count($rows); } catch (\InvalidArgumentException $exception) { return false; } catch (ElementNotFoundException $exception) { return false; } }
/** * {@inheritdoc} */ public function isThereShippingMethodNamed($name) { if (null === ($table = $this->getDocument()->find('css', 'table'))) { return false; } try { $row = $this->tableManipulator->getRowWithFields($table, ['name' => $name]); } catch (\InvalidArgumentException $exception) { return false; } return 1 === $row; }
/** * {@inheritdoc} */ public function getUsedThemeName($channelCode) { $table = $this->getDocument()->find('css', 'table'); $row = $this->tableManipulator->getRowWithFields($table, ['code' => $channelCode]); return trim($this->tableManipulator->getFieldFromRow($table, $row, 'theme')->getText()); }