Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
TierPrices.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
16 
22 class TierPrices implements ResolverInterface
23 {
29  public function resolve(
30  Field $field,
31  $context,
33  array $value = null,
34  array $args = null
35  ) {
36  if (!isset($value['model'])) {
37  throw new GraphQlInputException(__('"model" value should be specified'));
38  }
39 
41  $product = $value['model'];
42 
43  $tierPrices = null;
44  if ($product->getTierPrices()) {
45  $tierPrices = [];
47  foreach ($product->getTierPrices() as $tierPrice) {
48  $tierPrices[] = $tierPrice->getData();
49  }
50  }
51 
52  return $tierPrices;
53  }
54 }
__()
Definition: __.php:13
$value
Definition: gender.phtml:16
foreach( $_productCollection as $_product)() ?>" class $info
Definition: listing.phtml:52
resolve(Field $field, $context, ResolveInfo $info, array $value=null, array $args=null)