Commit 045e57d1 authored by Nick_vh's avatar Nick_vh

Renaming facetapi to facet_api for consitency and conventional reasons

parent 02480074
......@@ -72,13 +72,13 @@ before_script:
script:
# go to our Drupal module directory
- mkdir $TRAVIS_BUILD_DIR/../drupal/modules/facetapi
- cp -R $TRAVIS_BUILD_DIR/* $TRAVIS_BUILD_DIR/../drupal/modules/facetapi/
- mkdir $TRAVIS_BUILD_DIR/../drupal/modules/facet_api
- cp -R $TRAVIS_BUILD_DIR/* $TRAVIS_BUILD_DIR/../drupal/modules/facet_api/
# go to our Drupal main directory
- cd $TRAVIS_BUILD_DIR/../drupal
- ls -la $TRAVIS_BUILD_DIR/../drupal/sites/default
# Run the tests
- php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost "facetapi" | tee /tmp/test.txt ; export TEST_EXIT=${PIPESTATUS[0]} ; echo $TEST_EXIT
- php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost "facet_api" | tee /tmp/test.txt ; export TEST_EXIT=${PIPESTATUS[0]} ; echo $TEST_EXIT
# Check if we had fails in the run-tests.sh script
# Exit with the inverted value, because if there are no fails found, it will exit with 1 and for us that\
# is a good thing so invert it to 0. Travis has some issues with the exclamation mark in front so we have to fiddle a
......@@ -86,7 +86,7 @@ script:
# Also make the grep case insensitive and fail on run-tests.sh regular fails as well on fatal errors.
- TEST_OUTPUT=$(! egrep -i "([0-9]+ fails)|(PHP Fatal error)|([0-9]+ exceptions)" /tmp/test.txt > /dev/null)$?
- cd $TRAVIS_BUILD_DIR/../drupal/core
- ./vendor/bin/phpunit --group facetapi --verbose --debug --coverage-text | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT
- ./vendor/bin/phpunit --group facet_api --verbose --debug --coverage-text | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT
# if the TEST_EXIT status is 0 AND the TEST_OUTPUT status is also 0 it means we succeeded, in all other cases we
# failed.
# Re-enable when trying to get CodeSniffer doesn't return a 403 anymore.
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains facetapi.module
* Contains facet_api.module
*/
use Drupal\Core\Routing\RouteMatchInterface;
......@@ -11,11 +11,11 @@ use Drupal\Core\Routing\RouteMatchInterface;
* Implements hook_help().
*/
function facetapi_help($route_name, RouteMatchInterface $route_match)
function facet_api_help($route_name, RouteMatchInterface $route_match)
{
switch ($route_name) {
// Main module help for the facetapi module.
case 'help.page.facetapi':
// Main module help for the facet_api module.
case 'help.page.facet_api':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Facetapi test') . '</p>';
......@@ -28,7 +28,7 @@ function facetapi_help($route_name, RouteMatchInterface $route_match)
* Implements hook_theme().
*/
function facetapi_theme()
function facet_api_theme()
{
$theme = [];
......
services:
plugin.manager.facetapi.sort:
class: Drupal\facetapi\FacetApiSortManager
plugin.manager.facet_api.sort:
class: Drupal\facet_api\FacetApiSortManager
parent: default_plugin_manager
plugin.manager.facetapi.adapter:
class: Drupal\facetapi\AdapterManager
plugin.manager.facet_api.adapter:
class: Drupal\facet_api\AdapterManager
parent: default_plugin_manager
......@@ -2,10 +2,10 @@
/**
* @file
* Contains Drupal\facetapi\Plugin\AdapterInterface.
* Contains Drupal\facet_api\Plugin\AdapterInterface.
*/
namespace Drupal\facetapi\Adapter;
namespace Drupal\facet_api\Adapter;
interface AdapterInterface {
......@@ -21,7 +21,7 @@ interface AdapterInterface {
* the facet data.
*
* @param array $searcher_info
* The searcher information as returned by facetapi_get_searcher_info().
* The searcher information as returned by facet_api_get_searcher_info().
*/
//public function __construct(SearcherInterface $searcher);
......@@ -153,7 +153,7 @@ interface AdapterInterface {
* Returns a facet's active items.
*
* @param array|string $facet
* Either the facet definition as returned by facetapi_facet_load() or the
* Either the facet definition as returned by facet_api_facet_load() or the
* machine readable name of the facet.
*
* @return array
......@@ -286,7 +286,7 @@ interface AdapterInterface {
/**
* Allows for backend specific overrides to the settings form.
*
* @see facetapi_facet_display_form()
* @see facet_api_facet_display_form()
*/
public function settingsForm(&$form, &$form_state);
......@@ -370,9 +370,9 @@ interface AdapterInterface {
* returned by the backend, for example the display widget and sort settings.
*
* @param array $facet
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
* @param array $realm
* The realm definition as returned by facetapi_realm_load().
* The realm definition as returned by facet_api_realm_load().
*
* @return stdClass
* An object containing the settings.
......@@ -391,7 +391,7 @@ interface AdapterInterface {
* are configured globally and reflected across all realms for this searcher.
*
* @param array $facet
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
*
* @return
* An object containing the settings.
......@@ -410,7 +410,7 @@ interface AdapterInterface {
* @return array
* An array of enabled facets.
*
* @see facetapi_get_enabled_facets()
* @see facet_api_get_enabled_facets()
*/
public function getEnabledFacets($realm_name = NULL);
......@@ -418,7 +418,7 @@ interface AdapterInterface {
* Returns a FacetapiFacet instance for the facet being rendered.
*
* @param array $facet
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
*
* @return FacetapiFacet
* The facet rendering object object.
......@@ -429,7 +429,7 @@ interface AdapterInterface {
* Returns the facet's instantiated query type plugin.
*
* @param array|string $facet
* Either the facet definition as returned by facetapi_facet_load() or the
* Either the facet definition as returned by facet_api_facet_load() or the
* machine readable name of the facet.
*
* @return FacetapiQueryTypeInterface|NULL
......@@ -467,7 +467,7 @@ interface AdapterInterface {
* Helper function that returns the query string variables for a facet item.
*
* @param array $facet
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
* @param array $values
* An array containing the item's values being added to or removed from the
* query string dependent on whether or not the item is active.
......@@ -485,7 +485,7 @@ interface AdapterInterface {
* Helper function that returns the path for a facet link.
*
* @param array $facet
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
* @param array $values
* An array containing the item's values being added to or removed from the
* query string dependent on whether or not the item is active.
......
<?php
/**
* Contains Drupal\facetapi\AdapterManager
* Contains Drupal\facet_api\AdapterManager
*/
namespace Drupal\facetapi;
namespace Drupal\facet_api;
use Drupal\Core\Extension\ModuleHandlerInterface;
......@@ -13,9 +13,9 @@ use Drupal\Core\Cache\CacheBackendInterface;
class AdapterManager extends DefaultPluginManager {
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/Adapter', $namespaces, $module_handler, 'Drupal\facetapi\AdapterInterface', 'Drupal\facetapi\Annotation\FacetApiAdapter');
$this->alterInfo('facetapi_adapter_info');
$this->setCacheBackend($cache_backend, 'facetapi_adapter_plugins');
parent::__construct('Plugin/Adapter', $namespaces, $module_handler, 'Drupal\facet_api\AdapterInterface', 'Drupal\facet_api\Annotation\FacetApiAdapter');
$this->alterInfo('facet_api_adapter_info');
$this->setCacheBackend($cache_backend, 'facet_api_adapter_plugins');
}
}
\ No newline at end of file
......@@ -2,17 +2,17 @@
/**
* @file
* Contains \Drupal\facetapi\Annotation\FacetApiAdapter.
* Contains \Drupal\facet_api\Annotation\FacetApiAdapter.
*/
namespace Drupal\facetapi\Annotation;
namespace Drupal\facet_api\Annotation;
use Drupal\Component\Annotation\Plugin;
/**
* Defines a Facet API Adapter annotation object.
*
* @see \Drupal\facetapi\FacetApiAdapterManager
* @see \Drupal\facet_api\FacetApiAdapterManager
* @see plugin_api
*
* @ingroup plugin_api
......
......@@ -2,17 +2,17 @@
/**
* @file
* Contains \Drupal\facetapi\Annotation\FacetApiSort.
* Contains \Drupal\facet_api\Annotation\FacetApiSort.
*/
namespace Drupal\facetapi\Annotation;
namespace Drupal\facet_api\Annotation;
use Drupal\Component\Annotation\Plugin;
/**
* Defines a Facet API Sorter annotation object.
*
* @see \Drupal\facetapi\FacetApiSortManager
* @see \Drupal\facet_api\FacetApiSortManager
* @see plugin_api
*
* @Annotation
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains Drupal\facetapi\Facet.
* Contains Drupal\facet_api\Facet.
*/
namespace Drupal\facetapi;
namespace Drupal\facet_api;
/**
* Wrapper around the facet definition with methods that build render arrays.
......@@ -13,7 +13,7 @@ namespace Drupal\facetapi;
* Thic class contain methods that assist in render array generation and stores
* additional context about how and what generated the render arrays for
* consumption by the widget plugins. Objects can also be used as if they are
* the facet definitions returned by facetapi_facet_load().
* the facet definitions returned by facet_api_facet_load().
*
* @TODO: Remove ArrayAccess dependency... 'Cause we like object!
*/
......@@ -27,7 +27,7 @@ class Facet implements ArrayAccess {
protected $adapter;
/**
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
*
* This is the array acted on by the ArrayAccess interface methods so the
* object can be used as if it were the facet definition array.
......@@ -51,7 +51,7 @@ class Facet implements ArrayAccess {
* @param FacetapiAdapter $adapter
* he FacetapiAdapter object this class was instantiated from.
* @param array $facet
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
*/
public function __construct(FacetapiAdapter $adapter, array $facet) {
$this->adapter = $adapter;
......@@ -102,7 +102,7 @@ class Facet implements ArrayAccess {
}
/**
* Returns the facet definition as returned by facetapi_facet_load().
* Returns the facet definition as returned by facet_api_facet_load().
*
* @return array
* An array containing the facet definition.
......@@ -136,7 +136,7 @@ class Facet implements ArrayAccess {
*/
public function getSettings($realm = NULL) {
if ($realm && !is_array($realm)) {
$realm = facetapi_realm_load($realm);
$realm = facet_api_realm_load($realm);
}
$method = ($realm) ? 'getFacetSettings' : 'getFacetSettingsGlobal';
return $this->adapter->$method($this->facet, $realm);
......@@ -151,7 +151,7 @@ class Facet implements ArrayAccess {
* empty behavior plugin is executed to finalize the build.
*
* @param array $realm
* The realm definition as returned by facetapi_realm_load().
* The realm definition as returned by facet_api_realm_load().
* @param FacetapiFacetProcessor $processor
* The processor object.
*
......@@ -166,27 +166,27 @@ class Facet implements ArrayAccess {
// Execute the filter plugins.
// @todo Defensive coding here for filters?
$enabled_filters = array_filter($settings->settings['filters'], 'facetapi_filter_disabled_filters');
$enabled_filters = array_filter($settings->settings['filters'], 'facet_api_filter_disabled_filters');
uasort($enabled_filters, 'drupal_sort_weight');
foreach ($enabled_filters as $filter_id => $filter_settings) {
if ($class = ctools_plugin_load_class('facetapi', 'filters', $filter_id, 'handler')) {
if ($class = ctools_plugin_load_class('facet_api', 'filters', $filter_id, 'handler')) {
$filter_plugin = new $class($filter_id, $this->adapter, $settings);
$this->build = $filter_plugin->execute($this->build);
}
else {
watchdog('facetapi', 'Filter %name not valid.', array('%name' => $filter_id), WATCHDOG_ERROR);
watchdog('facet_api', 'Filter %name not valid.', array('%name' => $filter_id), WATCHDOG_ERROR);
}
}
// Instantiate and initialize the widget plugin.
// @todo Add defensive coding here for widgets?
$widget_name = $settings->settings['widget'];
if ($class = ctools_plugin_load_class('facetapi', 'widgets', $widget_name, 'handler')) {
if ($class = ctools_plugin_load_class('facet_api', 'widgets', $widget_name, 'handler')) {
$widget_plugin = new $class($widget_name, $realm, $this, $settings);
$widget_plugin->init();
}
else {
watchdog('facetapi', 'Widget %name not valid.', array('%name' => $widget_name), WATCHDOG_ERROR);
watchdog('facet_api', 'Widget %name not valid.', array('%name' => $widget_name), WATCHDOG_ERROR);
return array();
}
......@@ -198,7 +198,7 @@ class Facet implements ArrayAccess {
else {
// Instantiate the empty behavior plugin.
$id = $settings->settings['empty_behavior'];
$class = ctools_plugin_load_class('facetapi', 'empty_behaviors', $id, 'handler');
$class = ctools_plugin_load_class('facet_api', 'empty_behaviors', $id, 'handler');
$empty_plugin = new $class($settings);
// Execute the empty behavior plugin.
$build = $widget_plugin->getBuild();
......@@ -211,7 +211,7 @@ class Facet implements ArrayAccess {
}
// Add JavaScript settings by merging with the others already set.
$merge_settings['facetapi']['facets'][] = $widget_plugin->getJavaScriptSettings();
$merge_settings['facet_api']['facets'][] = $widget_plugin->getJavaScriptSettings();
drupal_add_js($merge_settings, 'setting');
// Return render array keyed by the FacetapiWidget::$key property.
......
<?php
/**
* Contains Drupal\facetapi\FacetProcessor
* Contains Drupal\facet_api\FacetProcessor
*/
namespace Drupal\facetapi;
namespace Drupal\facet_api;
/**
......@@ -262,7 +262,7 @@ class FacetProcessor {
// Since the children are copied to their parent's "#item_parents" property
// during processing, we have to filter the original child items from the
// top level of the hierarchy.
return array_filter($build, 'facetapi_filter_top_level_children');
return array_filter($build, 'facet_api_filter_top_level_children');
}
/**
......@@ -280,7 +280,7 @@ class FacetProcessor {
// Merges the childrens' values if the item is active so the children
// are deactivated along with the parent.
if ($item['#active']) {
$values = array_merge(facetapi_get_child_values($item['#item_children']), $values);
$values = array_merge(facet_api_get_child_values($item['#item_children']), $values);
}
}
// Stores this item's active children so we can deactivate them in the
......
This diff is collapsed.
<?php
/**
* Contains Drupal\facetapi\Plugin\TestAdapter
* Contains Drupal\facet_api\Plugin\TestAdapter
*/
namespace Drupal\facetapi\Plugin\Adapter;
namespace Drupal\facet_api\Plugin\Adapter;
/**
* @FacetApiAdapter(
* id = "test",
* label = @Translation("Test"),
* description = @Translation("Test class for facetapi adapter")
* description = @Translation("Test class for facet_api adapter")
* )
*/
class TestAdapter extends AdapterBase {
......
......@@ -2,15 +2,15 @@
/**
* @file
* Contains Drupal\facetapi\Plugin\Block\FacetBlock.
* Contains Drupal\facet_api\Plugin\Block\FacetBlock.
*/
namespace Drupal\facetapi\Plugin\Block;
namespace Drupal\facet_api\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\facetapi\Adapter;
use Drupal\facet_api\Adapter;
/**
* Provides a 'FacetBlock' block.
......@@ -23,11 +23,11 @@ use Drupal\facetapi\Adapter;
class FacetBlock extends BlockBase implements ContainerFactoryPluginInterface {
/**
* Drupal\facetapi\Adapter definition.
* Drupal\facet_api\Adapter definition.
*
* @var Drupal\facetapi\Adapter
* @var Drupal\facet_api\Adapter
*/
protected $facetapi_adapter;
protected $facet_api_adapter;
/**
* Construct.
......@@ -43,10 +43,10 @@ class FacetBlock extends BlockBase implements ContainerFactoryPluginInterface {
array $configuration,
$plugin_id,
$plugin_definition,
Adapter $facetapi_adapter
Adapter $facet_api_adapter
) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->facetapi_adapter = $facetapi_adapter;
$this->facet_api_adapter = $facet_api_adapter;
}
/**
......@@ -57,7 +57,7 @@ class FacetBlock extends BlockBase implements ContainerFactoryPluginInterface {
$configuration,
$plugin_id,
$plugin_definition,
$container->get('facetapi.adapter')
$container->get('facet_api.adapter')
);
}
......
<?php
namespace Drupal\facetapi\Plugin\FacetApi\Sort;
namespace Drupal\facet_api\Plugin\FacetApi\Sort;
use Drupal\facetapi\Sort\SortPluginBase;
use Drupal\facet_api\Sort\SortPluginBase;
/**
* @FacetApiSort(
* id = "facetapi_sort_active",
* id = "facet_api_sort_active",
* label = @Translation("Facet Active"),
* description = @Translation("Sort by whether the facet is active or not.")
* )
......
<?php
namespace Drupal\facetapi\Plugin\FacetApi\Sort;
namespace Drupal\facet_api\Plugin\FacetApi\Sort;
use Drupal\facetapi\Sort\SortPluginBase;
use Drupal\facet_api\Sort\SortPluginBase;
/**
* @FacetApiSort(
* id = "facetapi_sort_count",
* id = "facet_api_sort_count",
* label = @Translation("Count"),
* description = @Translation("Sort by the facet count.")
* )
......
<?php
namespace Drupal\facetapi\Plugin\FacetApi\Sort;
namespace Drupal\facet_api\Plugin\FacetApi\Sort;
use Drupal\facetapi\Sort\SortPluginBase;
use Drupal\facet_api\Sort\SortPluginBase;
/**
* @FacetApiSort(
* id = "facetapi_sort_display",
* id = "facet_api_sort_display",
* label = @Translation("Display value"),
* description = @Translation("Sort by the value displayed to the user.")
* )
......
<?php
namespace Drupal\facetapi\Plugin\FacetApi\Sort;
namespace Drupal\facet_api\Plugin\FacetApi\Sort;
use Drupal\facetapi\Sort\SortPluginBase;
use Drupal\facet_api\Sort\SortPluginBase;
/**
* @FacetApiSort(
* id = "facetapi_sort_indexed",
* id = "facet_api_sort_indexed",
* label = @Translation("Indexed value"),
* description = @Translation("Sort by the raw value stored in the index.")
* )
......
......@@ -3,12 +3,12 @@
/**
* @file
* Contains Drupal\facetapi\Plugin\Block\FacetUrlProcessor.
* Contains Drupal\facet_api\Plugin\Block\FacetUrlProcessor.
*/
namespace Drupal\facetapi\Plugin\Url;
namespace Drupal\facet_api\Plugin\Url;
use Drupal\facetapi\Plugin\Adapter\AdapterInterface;
use Drupal\facet_api\Plugin\Adapter\AdapterInterface;
/**
* In D7 this was the abstract class extended by all url processor plugins.
......@@ -22,7 +22,7 @@ use Drupal\facetapi\Plugin\Adapter\AdapterInterface;
* responsible for building facet links and setting breadcrumb trails.
*
* Each adapter instance was associated with a single url processor plugin. The
* plugin was associated with the adapter via hook_facetapi_searcher_info()
* plugin was associated with the adapter via hook_facet_api_searcher_info()
* implementations.
*
* All functions and comments in this class have currently been copy/pasted verbatim
......@@ -103,7 +103,7 @@ abstract class FacetUrlProcessor {
* more details.
*
* @param array $facet
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
* @param array $values
* An array containing the item's values being added to or removed from the
* query string dependent on whether or not the item is active.
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains Drupal\facetapi\Plugin\Block\FacetUrlProcessor.
* Contains Drupal\facet_api\Plugin\Block\FacetUrlProcessor.
*/
namespace Drupal\facetapi\Plugin\Url;
namespace Drupal\facet_api\Plugin\Url;
use \Drupal\Component\Utility\UrlHelper;
......@@ -62,7 +62,7 @@ class FacetUrlProcessorStandard extends FacetUrlProcessor {
* Implemented FacetapiUrlProcessor::getQueryString().
*
* @param array $facet
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
* @param array $values
* An array containing the item's values being added to or removed from the
* query string dependent on whether or not the item is active.
......@@ -111,7 +111,7 @@ class FacetUrlProcessorStandard extends FacetUrlProcessor {
* Checked the facet's global "limit_active_items" settings.
*
* @param array $facet
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
*
* @return int
* Whether or not to limit active items to one per facet.
......@@ -177,14 +177,14 @@ class FacetUrlProcessorStandard extends FacetUrlProcessor {
* Allowed for processor specific overrides to the settings form.
*/
public function settingsForm(&$form, &$form_state) {
$facet = $form['#facetapi']['facet'];
$facet = $form['#facet_api']['facet'];
$settings = $this->adapter->getFacetSettingsGlobal($facet);
// Add the limit active item field to the form
$form['global']['limit_active_items'] = array(
'#type' => 'checkbox',
'#title' => t('Limit to one active item'),
'#prefix' => '<div class="facetapi-global-setting">',
'#prefix' => '<div class="facet_api-global-setting">',
'#suffix' => '</div>',
'#default_value' => !empty($settings->settings['limit_active_items']),
'#description' => t('Enabling this option allows only one item to be active at a time.'),
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\facetapi\QueryInterface.
* Contains \Drupal\facet_api\QueryInterface.
*/
namespace Drupal\facetapi;
namespace Drupal\facet_api;
use Drupal\Core\Config\Entity\ConfigEntityInterface;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\facetapi\QueryTypeBase.
* Contains \Drupal\facet_api\QueryTypeBase.
*/
namespace Drupal\facetapi;
namespace Drupal\facet_api;
abstract class QueryTypeBase implements QueryTypeInterface {
......@@ -18,7 +18,7 @@ abstract class QueryTypeBase implements QueryTypeInterface {
protected $adapter;
/**
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
*
* @var array
*/
......@@ -30,7 +30,7 @@ abstract class QueryTypeBase implements QueryTypeInterface {
* @param FacetapiAdapter $adapter
* The adapter object associated with facet being queried.
* @param array $facet
* The facet definition as returned by facetapi_facet_load().
* The facet definition as returned by facet_api_facet_load().
*/
public function __construct(FacetapiAdapter $adapter, array $facet) {
$this->adapter = $adapter;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\facetapi\QueryTypeInterface.
* Contains \Drupal\facet_api\QueryTypeInterface.
*/
namespace Drupal\facetapi;
namespace Drupal\facet_api;
use Drupal\Core\Config\Entity\ConfigEntityInterface;
......
......@@ -2,10 +2,10 @@
/**
* @file
* Contains \Drupal\facetapi\Sort\SortInterface.
* Contains \Drupal\facet_api\Sort\SortInterface.
*/
namespace Drupal\facetapi\Sort;
namespace Drupal\facet_api\Sort;
use Drupal\Component\Plugin\ConfigurablePluginInterface;
......@@ -17,46 +17,46 @@ use Drupal\Component\Plugin\ConfigurablePluginInterface;
interface SortInterface extends PluginInspectionInterface {
/**
* Returns the id of the facetapi sort.
* Returns the id of the facet_api sort.
*
* @return mixed
*/
public function getId();
/**
* Returns the label of the facetapi sort.
* Returns the label of the facet_api sort.
*
* @return string
*/
public function getLabel();
/**
* Returns the description of the facetapi sort.
* Returns the description of the facet_api sort.
*
* @return string
*/
public function getDescription();
/**
* Returns the weight of the facetapi sort.
* Returns the weight of the facet_api sort.
*
* @return int|string
* Either the integer weight of the facetapi sort, or an empty string.
* Either the integer weight of the facet_api sort, or an empty string.
*/
public function getWeight();
/**
* Sets the weight for this facetapi sort.
* Sets the weight for this facet_api sort.
*
* @param int $weight
* The weight for this facetapi sort.
* The weight for this facet_api sort.
*
* @return $this
*/
public function setWeight($weight);
/**
* Function that actually sorts the facetapi results.
* Function that actually sorts the facet_api results.
*
* @param array $a
* @param array $b
......
<?php
/**
* @file
* Provides \Drupal\facetapi\SortPluginBase;
* Provides \Drupal\facet_api\SortPluginBase;
*/
namespace Drupal\facetapi\Sort;
namespace Drupal\facet_api\Sort;
use Drupal\Component\Plugin\PluginBase;
use Drupal\facetapi\Sort\SortInterface;
use Drupal\facet_api\Sort\SortInterface;
class SortPluginBase extends PluginBase implements SortInterface {
private $weight;
/**
* Returns the id of the facetapi sort.
* Returns the id of the facet_api sort.
*
* @return mixed
*/
......@@ -23,7 +23,7 @@ class SortPluginBase extends PluginBase implements SortInterface {
}
/**
* Returns the label of the facetapi sort.