/**
  * Gets the mapped fields as an array mapping field names to values.
  *
  * @throws InvalidFieldNameException
  * @return array An array mapping field names to their values.
  */
 protected function getMappedFields()
 {
     $fields = array();
     foreach ($this->mappedFieldNames as $mappedFieldName) {
         if (!AbstractIndexer::isAllowedToOverrideField($mappedFieldName)) {
             throw new InvalidFieldNameException('Must not overwrite field "type".', 1435441863);
         }
         $fields[$mappedFieldName] = $this->resolveFieldValue($mappedFieldName);
     }
     return $fields;
 }
예제 #2
0
 /**
  * @test
  */
 public function testTypeIsNotAllowedOverride()
 {
     $this->assertFalse(AbstractIndexer::isAllowedToOverrideField('type'), 'Type is allowed to override');
     $this->assertTrue(AbstractIndexer::isAllowedToOverrideField('test_stringS'), 'New dynamic fields was not indicated to be overrideable');
 }