コード例 #1
0
ファイル: IndexPage.php プロジェクト: ahmadrabie/Sylius
 /**
  * {@inheritdoc}
  */
 public function isThereProduct(ProductInterface $product)
 {
     if (!($table = $this->getDocument()->find('css', 'table'))) {
         return false;
     }
     $row = $this->tableAccessor->getRowWithFields($table, ['id' => $product->getId()]);
     return null === $row;
 }
コード例 #2
0
ファイル: IndexPage.php プロジェクト: ReissClothing/Sylius
 /**
  * {@inheritdoc}
  */
 public function isOrderWithNumberInTheList($number)
 {
     try {
         $rows = $this->tableAccessor->getRowsWithFields($this->getElement('customer_orders'), ['number' => $number]);
         return 1 === count($rows);
     } catch (\InvalidArgumentException $exception) {
         return false;
     }
 }
コード例 #3
0
ファイル: CompletePage.php プロジェクト: ReissClothing/Sylius
 /**
  * {@inheritdoc}
  */
 public function hasItemWithProductAndQuantity($productName, $quantity)
 {
     $table = $this->getElement('items_table');
     try {
         $this->tableAccessor->getRowWithFields($table, ['item' => $productName, 'qty' => $quantity]);
     } catch (\InvalidArgumentException $exception) {
         return false;
     }
     return true;
 }
コード例 #4
0
ファイル: IndexPage.php プロジェクト: ahmadrabie/Sylius
 /**
  * {@inheritdoc}
  */
 public function isResourceOnPage(array $parameters)
 {
     try {
         $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), $parameters);
         return 1 === count($rows);
     } catch (\InvalidArgumentException $exception) {
         return false;
     } catch (ElementNotFoundException $exception) {
         return false;
     }
 }
コード例 #5
0
ファイル: IndexPage.php プロジェクト: ahmadrabie/Sylius
 /**
  * {@inheritdoc}
  */
 public function isThereShippingMethodNamed($name)
 {
     if (null === ($table = $this->getDocument()->find('css', 'table'))) {
         return false;
     }
     try {
         $row = $this->tableAccessor->getRowWithFields($table, ['name' => $name]);
     } catch (\InvalidArgumentException $exception) {
         return false;
     }
     return 1 === $row;
 }
コード例 #6
0
ファイル: IndexPage.php プロジェクト: NeverResponse/Sylius
 /**
  * {@inheritdoc}
  */
 public function isSingleResourceWithSpecificElementOnPage(array $parameters, $element)
 {
     try {
         $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), $parameters);
         if (1 !== count($rows)) {
             return false;
         }
         return null !== $rows[0]->find('css', $element);
     } catch (\InvalidArgumentException $exception) {
         return false;
     } catch (ElementNotFoundException $exception) {
         return false;
     }
 }
コード例 #7
0
ファイル: ShowPage.php プロジェクト: gabiudrescu/Sylius
 /**
  * {@inheritdoc}
  */
 public function isProductInTheList($name)
 {
     try {
         $rows = $this->tableAccessor->getRowsWithFields($this->getElement('order_items'), ['item' => $name]);
         return 1 === count($rows);
     } catch (\InvalidArgumentException $exception) {
         return false;
     }
 }
コード例 #8
0
ファイル: ShowPage.php プロジェクト: ReissClothing/Sylius
 /**
  * @param string $itemName
  * @param string $property
  *
  * @return string
  */
 private function getItemProperty($itemName, $property)
 {
     $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), ['item' => $itemName]);
     return $rows[0]->find('css', '.' . $property)->getText();
 }
コード例 #9
0
ファイル: OrderPaymentsPage.php プロジェクト: rpg600/Sylius
 /**
  * {@inheritdoc}
  */
 public function countPaymentWithSpecificState($state)
 {
     $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), ['state' => $state]);
     return count($rows);
 }
コード例 #10
0
 /**
  * {@inheritdoc}
  */
 public function getNumberOfNewCustomersInTheList()
 {
     return $this->tableAccessor->countTableBodyRows($this->getElement('customer_list'));
 }
コード例 #11
0
ファイル: IndexPage.php プロジェクト: sylius/sylius
 /**
  * {@inheritDoc}
  */
 public function isItPossibleToChangePaymentMethodForOrder(OrderInterface $order)
 {
     $row = $this->tableAccessor->getRowWithFields($this->getElement('customer_orders'), ['number' => $order->getNumber()]);
     return $row->hasLink('Pay');
 }
コード例 #12
0
ファイル: IndexPage.php プロジェクト: ahmadrabie/Sylius
 /**
  * {@inheritdoc}
  */
 public function getUsedThemeName($channelCode)
 {
     $table = $this->getDocument()->find('css', 'table');
     $row = $this->tableAccessor->getRowWithFields($table, ['code' => $channelCode]);
     return trim($this->tableAccessor->getFieldFromRow($table, $row, 'theme')->getText());
 }