original_string: public function getPreparseFieldsContent(Element $element, string $eventHandle)
      {
          $content = [];
          $fieldLayout = $element->getFieldLayout();
  
          if ($fieldLayout) {
              foreach ($fieldLayout->getFields() as $field) {
                  if ($field && \get_class($field) === 'aelvan\preparsefield\fields\PreparseFieldType') {
                      /** @var PreparseFieldType $field */
  
                      // only get field content for the right event listener
                      $isBeforeSave = ($eventHandle === 'onBeforeSave');
                      $parseBeforeSave = (bool)$field->parseBeforeSave;
  
                      if ($isBeforeSave === $parseBeforeSave) {
                          $fieldValue = $this->parseField($field, $element);
  
                          if ($fieldValue !== null) {
                              $content[$field->handle] = $fieldValue;
                          }
                      }
                  }
              }
          }
  
          return $content;
      }
code: public function getPreparseFieldsContent(Element $element, string $eventHandle)
      {
          $content = [];
          $fieldLayout = $element->getFieldLayout();
  
          if ($fieldLayout) {
              foreach ($fieldLayout->getFields() as $field) {
                  if ($field && \get_class($field) === 'aelvan\preparsefield\fields\PreparseFieldType') {
                      /** @var PreparseFieldType $field */
  
                      // only get field content for the right event listener
                      $isBeforeSave = ($eventHandle === 'onBeforeSave');
                      $parseBeforeSave = (bool)$field->parseBeforeSave;
  
                      if ($isBeforeSave === $parseBeforeSave) {
                          $fieldValue = $this->parseField($field, $element);
  
                          if ($fieldValue !== null) {
                              $content[$field->handle] = $fieldValue;
                          }
                      }
                  }
              }
          }
  
          return $content;
      }
code_tokens: public function getPreparseFieldsContent ( Element $ element , string $ eventHandle ) { $ content = [ ] ; $ fieldLayout = $ element -> getFieldLayout ( ) ; if ( $ fieldLayout ) { foreach ( $ fieldLayout -> getFields ( ) as $ field ) { if ( $ field && \ get_class ( $ field ) === 'aelvan\preparsefield\fields\PreparseFieldType' ) { /** @var PreparseFieldType $field */ // only get field content for the right event listener $ isBeforeSave = ( $ eventHandle === 'onBeforeSave' ) ; $ parseBeforeSave = ( bool ) $ field -> parseBeforeSave ; if ( $ isBeforeSave === $ parseBeforeSave ) { $ fieldValue = $ this -> parseField ( $ field , $ element ) ; if ( $ fieldValue !== null ) { $ content [ $ field -> handle ] = $ fieldValue ; } } } } } return $ content ; }
docstring: Loops over fields in element to determine if they have preparse fields.
  
  @param Element $element
  @param string  $eventHandle
  
  @return array
docstring_tokens: Loops over fields in element to determine if they have preparse fields .