Example #1
0
 /**
  * {@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;
 }
Example #2
0
 /**
  * {@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;
     }
 }
Example #3
0
 /**
  * {@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;
 }
Example #4
0
 /**
  * {@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());
 }