コード例 #1
0
 public function formatSimpleFieldInResource(Resource $resource, $fieldAlias, $fieldValue)
 {
     $fieldObj = $resource->getFieldByAlias($fieldAlias);
     $fieldFormatter = $this->fieldFormatterFactory->buildFieldFormatterForField($fieldObj);
     return $fieldFormatter->format($fieldValue);
 }
コード例 #2
0
 public function test_that_a_bool_field_get_bool_formatter()
 {
     $testField = $this->generateTestField(Field::TYPE_BOOL);
     $this->assertInstanceOf('FlyRRM\\Formatting\\Field\\BoolFieldFormatter', $this->factory->buildFieldFormatterForField($testField));
 }