You are here

function paragraphs_pack_get_field_file in Paragraphs pack 7

Get/Create file field.

This field can be used only on paragraph entity type.

Parameters

string $uri_scheme: A name of a scheme (private/public).

Return value

array An array containing field values.

3 calls to paragraphs_pack_get_field_file()
ParagraphsPackTestCase::testParagraphsPackFieldFileCreation in tests/paragraphs_pack.test
Test function for field file creation.
ParagraphsPackTestCase::testParagraphsPackFieldFileInstanceCreation in tests/paragraphs_pack.test
Test function for field file instance creation.
paragraphs_pack_add_field_file in includes/paragraphs_pack.fields_crud.inc
Adds file field to a paragraph bundle.

File

includes/paragraphs_pack.fields_crud.inc, line 312
Fields CRUD functions.

Code

function paragraphs_pack_get_field_file($uri_scheme = '') {
  $field = _paragraphs_pack_get_field(array(
    'field_name' => PP_FIELD_FILE,
    'type' => 'file',
    'entity_types' => array(
      PP_PARAGRAPH_TYPE,
    ),
    'cardinality' => -1,
    'settings' => array(
      'display_default' => 0,
      'display_field' => 0,
      'uri_scheme' => variable_get('file_default_scheme', 'public'),
    ),
  ));
  if (!empty($uri_scheme)) {
    $field['settings']['uri_scheme'] = $uri_scheme;
  }
  return $field;
}