You are here

RestfulTestMainResource__1_2.class.php in RESTful 7

Contains RestfulTestMainResource__1_2.

File

tests/modules/restful_test/plugins/restful/entity_test/main/1.2/RestfulTestMainResource__1_2.class.php
View source
<?php

/**
 * @file
 * Contains RestfulTestMainResource__1_2.
 */
class RestfulTestMainResource__1_2 extends RestfulTestMainResource {

  /**
   * Overrides RestfulTestEntityTestsResource::publicFieldsInfo().
   */
  public function publicFieldsInfo() {
    $public_fields = parent::publicFieldsInfo();
    $public_fields['callback'] = array(
      'callback' => array(
        $this,
        'callback',
      ),
    );
    $public_fields['process_callback_from_callback'] = array(
      'callback' => array(
        $this,
        'callback',
      ),
      'process_callbacks' => array(
        array(
          $this,
          'processCallbackFromCallback',
        ),
      ),
    );
    $public_fields['process_callback_from_value'] = array(
      'wrapper_method' => 'getIdentifier',
      'wrapper_method_on_entity' => TRUE,
      'process_callbacks' => array(
        array(
          $this,
          'processCallbackFromValue',
        ),
      ),
    );
    return $public_fields;
  }

  /**
   * Return a computed value.
   */
  protected function callback() {
    return 'callback';
  }

  /**
   * Process a computed value.
   */
  protected function processCallbackFromCallback($value) {
    return $value . ' processed from callback';
  }

  /**
   * Process a property value.
   */
  protected function processCallbackFromValue($value) {
    return $value . ' processed from value';
  }

}

Classes

Namesort descending Description
RestfulTestMainResource__1_2 @file Contains RestfulTestMainResource__1_2.