You are here

protected function RestfulEntityBase::getBundlesForAutocomplete in RESTful 7

Return the bundles that should be used for the autocomplete search.

Return value

array Array with the bundle name(s).

1 call to RestfulEntityBase::getBundlesForAutocomplete()
RestfulEntityBase::getQueryForAutocomplete in plugins/restful/RestfulEntityBase.php
Request the query object to get a list for autocomplete.

File

plugins/restful/RestfulEntityBase.php, line 204
Contains RestfulEntityBase.

Class

RestfulEntityBase
An abstract implementation of RestfulEntityInterface.

Code

protected function getBundlesForAutocomplete() {
  $info = $this
    ->getEntityInfo();

  // When a bundle key wasn't defined return false in order to make the
  // autocomplete support entities without bundle key. i.e: user, vocabulary.
  $bundle = $this
    ->getBundle();
  return !empty($bundle) && !empty($info['entity keys']['bundle']) ? array(
    $bundle,
  ) : FALSE;
}