Skip to content

Commit

Permalink
Merge pull request #438 from kzoltan/7.x-1.x
Browse files Browse the repository at this point in the history
Support for field collections
  • Loading branch information
e0ipso committed Mar 18, 2015
2 parents 29ed7bc + 19064ea commit e0b858c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/restful/RestfulEntityBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ protected function getTargetTypeFromEntityReference(\EntityMetadataWrapper $wrap
elseif ($field['type'] == 'taxonomy_term_reference') {
return 'taxonomy_term';
}
elseif ($field['type'] == 'field_collection') {
return 'field_collection_item';
}

throw new \RestfulException(format_string('Field @property is not an entity reference or taxonomy reference field.', $params));
}
Expand Down Expand Up @@ -715,6 +718,7 @@ public function propertyValuesPreprocess($property_name, $value, $public_field_n
switch ($field_info['type']) {
case 'entityreference':
case 'taxonomy_term_reference':
case 'field_collection':
return $this->propertyValuesPreprocessReference($property_name, $value, $field_info, $public_field_name);

case 'text':
Expand Down Expand Up @@ -1384,6 +1388,7 @@ protected function formSchemaHasAllowedValues($field, $instance) {
$field_types = array(
'entityreference',
'taxonomy_term_reference',
'field_collection',
);

$widget_types = array(
Expand Down

0 comments on commit e0b858c

Please sign in to comment.