Main__1_2.php in RESTful 7.2
File
tests/modules/restful_test/src/Plugin/resource/entity_test/main/v1/Main__1_2.php
View source
<?php
namespace Drupal\restful_test\Plugin\resource\entity_test\main\v1;
use Drupal\restful\Plugin\resource\DataInterpreter\DataInterpreterInterface;
use Drupal\restful\Plugin\resource\ResourceInterface;
class Main__1_2 extends Main__1_0 implements ResourceInterface {
protected function publicFields() {
$public_fields = parent::publicFields();
$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;
}
public function callback(DataInterpreterInterface $interpreter) {
return 'callback';
}
public function processCallbackFromCallback($value) {
return $value . ' processed from callback';
}
public function processCallbackFromValue($value) {
return $value . ' processed from value';
}
}
Classes
Name |
Description |
Main__1_2 |
Class Main__1_2
@package Drupal\restful_test\Plugin\resource |