Comments__1_0.php in RESTful 7.2
File
modules/restful_example/src/Plugin/resource/comment/Comments__1_0.php
View source
<?php
namespace Drupal\restful_example\Plugin\resource\comment;
use Drupal\restful\Plugin\resource\ResourceEntity;
use Drupal\restful\Plugin\resource\ResourceInterface;
class Comments__1_0 extends ResourceEntity implements ResourceInterface {
protected function publicFields() {
$public_fields = parent::publicFields();
$public_fields['nid'] = array(
'property' => 'node',
'sub_property' => 'nid',
);
if (field_info_field('comment_text')) {
$public_fields['comment_text'] = array(
'property' => 'comment_text',
'sub_property' => 'value',
);
}
return $public_fields;
}
protected function dataProviderClassName() {
return '\\Drupal\\restful_example\\Plugin\\resource\\comment\\DataProviderComment';
}
}
Classes
Name |
Description |
Comments__1_0 |
Class Comments__1_0
@package Drupal\restful_example\Plugin\resource\comment |