コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function alterPropertyDefinitions(array &$properties, DatasourceInterface $datasource = NULL)
 {
     if ($datasource) {
         return;
     }
     $definition = array('type' => 'string', 'label' => $this->t('Item language'), 'description' => $this->t('The language code of the item'));
     $properties['search_api_language'] = BasicProperty::createFromDefinition($definition)->setLocked();
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function alterPropertyDefinitions(array &$properties, DatasourceInterface $datasource = NULL)
 {
     if ($datasource) {
         return;
     }
     $definition = array('label' => $this->t('URI'), 'description' => $this->t('A URI where the item can be accessed'), 'type' => 'uri');
     $properties['search_api_url'] = BasicProperty::createFromDefinition($definition)->setLocked();
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function alterPropertyDefinitions(array &$properties, DatasourceInterface $datasource = NULL)
 {
     if ($datasource) {
         $entity_type = $datasource->getEntityTypeId();
         if (in_array($entity_type, array('node', 'comment'))) {
             $properties['status'] = ProxyProperty::create($properties['status'])->setLocked();
             if ($entity_type == 'node') {
                 $properties['uid'] = ProxyProperty::create($properties['uid'])->setLocked();
             }
         }
         return;
     }
     $definition = array('label' => $this->t('Node access information'), 'description' => $this->t('Data needed to apply node access.'), 'type' => 'string');
     $properties['search_api_node_grants'] = BasicProperty::createFromDefinition($definition)->setLocked()->setHidden();
 }
コード例 #4
0
 /**
  * {@inheritdoc}
  */
 public function alterPropertyDefinitions(array &$properties, DatasourceInterface $datasource = NULL)
 {
     if ($datasource) {
         return;
     }
     $types = $this->getTypes('type');
     if (isset($this->configuration['fields'])) {
         $index_fields = $this->index->getFields(FALSE);
         foreach ($this->configuration['fields'] as $field_id => $field) {
             $definition = array('label' => $field['label'], 'description' => $this->fieldDescription($field, $index_fields), 'type' => $types[$field['type']]);
             $properties[$field_id] = BasicProperty::createFromDefinition($definition)->setLocked();
         }
     }
 }
コード例 #5
0
 /**
  * {@inheritdoc}
  */
 public function alterPropertyDefinitions(array &$properties, DatasourceInterface $datasource = NULL)
 {
     if ($datasource) {
         return;
     }
     $definition = array('type' => 'string', 'label' => $this->t('Rendered HTML output'), 'description' => $this->t('The complete HTML which would be displayed when viewing the item'));
     $properties['rendered_item'] = BasicProperty::createFromDefinition($definition)->setLocked();
 }