Пример #1
0
 /**
  * @param \Generated\Shared\Transfer\ClauseTransfer $clauseTransfer
  *
  * @throws \Spryker\Zed\Discount\Business\Exception\QueryStringException
  *
  * @return void
  */
 protected function validateIfFieldIsRegistered(ClauseTransfer $clauseTransfer)
 {
     $clauseField = $clauseTransfer->getField();
     if ($clauseTransfer->getAttribute()) {
         $clauseField = $clauseField . '.' . $clauseTransfer->getAttribute();
     }
     foreach ($this->metaDataProvider->getAvailableFields() as $field) {
         if ($field === $clauseField) {
             return;
         }
     }
     throw new QueryStringException(sprintf('Could not found for field with name "%s".', $clauseTransfer->getField()));
 }