|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Drupal\reserve\Plugin\Field\FieldType; |
|
|
|
|
|
|
|
|
|
use Drupal\Core\Field\FieldItemBase; |
|
|
|
@ -21,7 +21,7 @@ use Drupal\Core\TypedData\DataDefinition;
|
|
|
|
|
* category = @Translation("Reference"), |
|
|
|
|
* cardinality = 1, |
|
|
|
|
* ) |
|
|
|
|
* |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
class ReserveCategory extends FieldItemBase implements FieldItemInterface { |
|
|
|
|
/** |
|
|
|
@ -64,7 +64,8 @@ class ReserveCategory extends FieldItemBase implements FieldItemInterface {
|
|
|
|
|
*/ |
|
|
|
|
public function fieldSettingsForm(array $form, FormStateInterface $form_state) { |
|
|
|
|
// get a list of all Reserve Categories |
|
|
|
|
$ids = \Drupal::entityQuery('reserve_category')->sort('name', 'ASC')->execute(); |
|
|
|
|
$ids = \Drupal::entityQuery('reserve_category')->accessCheck(TRUE) |
|
|
|
|
->sort('name', 'ASC')->execute(); |
|
|
|
|
$categories = \Drupal\reserve\Entity\ReserveCategory::loadMultiple($ids); |
|
|
|
|
$options = array(); |
|
|
|
|
foreach ($categories as $cat) { |
|
|
|
@ -113,4 +114,4 @@ class ReserveCategory extends FieldItemBase implements FieldItemInterface {
|
|
|
|
|
] + parent::defaultFieldSettings(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|