You are here

class RealisticDummyContentTextWithSummaryField in Realistic Dummy Content 7

Represents the text with summary field, which must have a text format when part of an entity object. Node body is one example.

Hierarchy

Expanded class hierarchy of RealisticDummyContentTextWithSummaryField

2 string references to 'RealisticDummyContentTextWithSummaryField'
hook_realistic_dummy_content_attribute_manipulator_alter in api/realistic_dummy_content_api.api.php
realistic_dummy_content_api_realistic_dummy_content_attribute_manipulator_alter in api/realistic_dummy_content_api.module
Implements hook_realistic_dummy_content_attribute_manipulator_alter().

File

api/includes/RealisticDummyContentTextWithSummaryField.inc, line 13
Define RealisticDummyContentTextWithSummaryField autoload class.

View source
class RealisticDummyContentTextWithSummaryField extends RealisticDummyContentField {

  /**
   * {@inheritdoc}
   */
  function ValueFromFile_($file) {
    $value = $file
      ->Value();

    // @TODO use the site's default, not filtered_html, as the default format.
    $format = $file
      ->Attribute('format', 'filtered_html');

    // If the value cannot be determined, which is different from an empty string.
    if ($value === NULL) {
      return NULL;
    }
    if ($value) {
      return array(
        LANGUAGE_NONE => array(
          array(
            'value' => $value,
            'format' => $format,
          ),
        ),
      );
    }
    else {
      return array();
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RealisticDummyContentAttribute::$entity private property The entity is set on construction and is a subclass of RealisticDummyContentEntityBase. It contains information about the entity to which this field instance is attached.
RealisticDummyContentAttribute::$name private property The name of this attribuet, for example title, picture, field_image...
RealisticDummyContentAttribute::Change function Changes this attribute by looking for data in files.
RealisticDummyContentAttribute::ChangeFromFiles function Given candidate files, change the value of this attribute based on one of them.
RealisticDummyContentAttribute::env function Returns the appropriate environment, real or testing.
RealisticDummyContentAttribute::FileSave function Return a file object.
RealisticDummyContentAttribute::GetBundle function Gets the bundle of the associated entity.
RealisticDummyContentAttribute::GetCandidateFiles function Get all candidate files for a given field for this entity.
RealisticDummyContentAttribute::GetEntity function Getter for $this->entity
RealisticDummyContentAttribute::GetEntityType function Get the entity type of the associated entity.
RealisticDummyContentAttribute::GetExtensions function Get acceptable file extensions which contain data for this attribute. 2
RealisticDummyContentAttribute::GetImageExtensions function Return acceptable image file extensions.
RealisticDummyContentAttribute::GetName function Getter for $this->name
RealisticDummyContentAttribute::GetTextExtensions function Return acceptable text file extensions.
RealisticDummyContentAttribute::GetUid function Gets the UID of the associated entity.
RealisticDummyContentAttribute::ImageSave function Return an image file object if possible.
RealisticDummyContentAttribute::rand function Returns a pseudo-random number.
RealisticDummyContentAttribute::ValueFromFile function Given a RealisticDummyContentFileGroup object, get structured property if extentions ok.
RealisticDummyContentAttribute::ValueFromFiles function Given a list of files, return a value from one of them.
RealisticDummyContentAttribute::__construct function Constructor.
RealisticDummyContentField::GetType function Returns the type of this attribute. Overrides RealisticDummyContentAttribute::GetType
RealisticDummyContentTextWithSummaryField::ValueFromFile_ function Given a RealisticDummyContentFileGroup object, get a structured property Overrides RealisticDummyContentAttribute::ValueFromFile_