Abstract Class FinderIndexerAdapter

Description

Prototype adapter class for the Finder indexer package.

  • abstract:
  • since: 2.5

Located in /administrator/components/com_finder/helpers/indexer/adapter.php (line 24)

JObject
   |
   --JEvent
      |
      --JPlugin
         |
         --FinderIndexerAdapter
Direct descendents
Class Description
 class PlgFinderCategories Finder adapter for Joomla Categories.
 class PlgFinderContacts Finder adapter for Joomla Contacts.
 class PlgFinderContent Finder adapter for com_content.
 class PlgFinderNewsfeeds Finder adapter for Joomla Newsfeeds.
 class PlgFinderTags Finder adapter for Joomla Tag.
 class PlgFinderWeblinks Finder adapter for Joomla Web Links.
Variable Summary
 string $context
 object $db
 string $extension
 string $layout
 string $mime
 integer $old_access
 integer $old_cataccess
 string $state_field
 string $table
 integer $type_id
 string $type_title
Method Summary
 FinderIndexerAdapter __construct (object &$subject, array $config)
 void categoryStateChange (array $pks, integer $value)
 boolean change (string $id, string $property, integer $value)
 void checkItemAccess (JTable $row)
 integer getContentCount ()
 FinderIndexerResult getItem (integer $id)
 mixed getItemMenuTitle (string $url)
 array getItems (integer $offset, integer $limit, [JDatabaseQuery $query = null])
 JDatabaseQuery getListQuery ([mixed $query = null])
 string getPluginType (integer $id)
 integer getTypeId ()
 string getURL (integer $id, string $extension, string $view)
 boolean index (FinderIndexerResult $item)
 void itemAccessChange (JTable $row)
 void itemStateChange (array $pks, integer $value)
 boolean onBeforeIndex ()
 boolean onBuildIndex ()
 boolean onStartIndex ()
 void pluginDisable (array $pks)
 boolean reindex (integer $id)
 boolean remove (string $id)
 boolean setup ()
 integer translateState (integer $item, [integer $category = null])
Variables
string $context (line 35)

The context is somewhat arbitrary but it must be unique or there will be conflicts when managing plugin/indexer state. A good best practice is to use the plugin name suffix as the context. For example, if the plugin is named 'plgFinderContent', the context could be 'Content'.

  • since: 2.5
  • access: protected

Redefined in descendants as:
object $db (line 99)

The database object.

  • since: 2.5
  • access: protected
string $extension (line 43)

The extension name.

  • since: 2.5
  • access: protected

Redefined in descendants as:
FinderIndexer $indexer (line 115)

The indexer object.

  • since: 3.0
  • access: protected
string $layout (line 51)

The sublayout to use when rendering the results.

  • since: 2.5
  • access: protected

Redefined in descendants as:
string $mime (line 59)

The mime type of the content the adapter indexes.

  • since: 2.5
  • access: protected
integer $old_access (line 67)

The access level of an item before save.

  • since: 2.5
  • access: protected
integer $old_cataccess (line 75)

The access level of a category before save.

  • since: 2.5
  • access: protected
string $state_field = 'state' (line 123)

The field the published state is stored in.

  • since: 2.5
  • access: protected

Redefined in descendants as:
string $table (line 107)

The table name.

  • since: 2.5
  • access: protected

Redefined in descendants as:
integer $type_id (line 91)

The type id of the content.

  • since: 2.5
  • access: protected
string $type_title (line 83)

The type of content the adapter indexes.

  • since: 2.5
  • access: protected

Redefined in descendants as:

Inherited Variables

Inherited from JPlugin

JPlugin::$autoloadLanguage
JPlugin::$params
JPlugin::$_name
JPlugin::$_type

Inherited from JEvent

JEvent::$_subject

Inherited from JObject

JObject::$_errors
Methods
Constructor __construct (line 133)

Method to instantiate the indexer adapter.

  • since: 2.5
  • access: public
FinderIndexerAdapter __construct (object &$subject, array $config)
  • object &$subject: The object to observe.
  • array $config: An array that holds the plugin configuration.

Redefinition of:
JPlugin::__construct()
Constructor
categoryAccessChange (line 390)

Method to update index data on category access level changes

  • since: 2.5
  • access: protected
void categoryAccessChange (JTable $row)
  • JTable $row: A JTable object
categoryStateChange (line 423)

Method to update index data on category access level changes

  • since: 2.5
  • access: protected
void categoryStateChange (array $pks, integer $value)
  • array $pks: A list of primary key ids of the content that has changed state.
  • integer $value: The value of the state that the content has been changed to.
change (line 277)

Method to change the value of a content item's property in the links table. This is used to synchronize published and access states that are changed when not editing an item directly.

  • return: True on success.
  • since: 2.5
  • throws: Exception on database error.
  • access: protected
boolean change (string $id, string $property, integer $value)
  • string $id: The ID of the item to change.
  • string $property: The property that is being changed.
  • integer $value: The new value of that property.
checkCategoryAccess (line 463)

Method to check the existing access level for categories

  • since: 2.5
  • access: protected
void checkCategoryAccess (JTable $row)
  • JTable $row: A JTable object
checkItemAccess (line 484)

Method to check the existing access level for items

  • since: 2.5
  • access: protected
void checkItemAccess (JTable $row)
  • JTable $row: A JTable object
getContentCount (line 504)

Method to get the number of content items available to index.

  • return: The number of content items available to index.
  • since: 2.5
  • throws: Exception on database error.
  • access: protected
integer getContentCount ()
getItem (line 543)

Method to get a content item to index.

  • return: A FinderIndexerResult object.
  • since: 2.5
  • throws: Exception on database error.
  • access: protected
FinderIndexerResult getItem (integer $id)
  • integer $id: The id of the content item.
getItemMenuTitle (line 763)

Method to get the page title of any menu item that is linked to the content item, if it exists and is set.

  • return: The title on success, null if not found.
  • since: 2.5
  • throws: Exception on database error.
  • access: protected
mixed getItemMenuTitle (string $url)
  • string $url: The url of the item.
getItems (line 577)

Method to get a list of content items to index.

  • return: An array of FinderIndexerResult objects.
  • since: 2.5
  • throws: Exception on database error.
  • access: protected
array getItems (integer $offset, integer $limit, [JDatabaseQuery $query = null])
  • integer $offset: The list offset.
  • integer $limit: The list limit.
  • JDatabaseQuery $query: A JDatabaseQuery object. [optional]
getListQuery (line 622)

Method to get the SQL query used to retrieve the list of content items.

  • return: A database object.
  • since: 2.5
  • access: protected
JDatabaseQuery getListQuery ([mixed $query = null])
  • mixed $query: A JDatabaseQuery object. [optional]

Redefined in descendants as:
getPluginType (line 639)

Method to get the plugin type

  • return: The plugin type
  • since: 2.5
  • access: protected
string getPluginType (integer $id)
  • integer $id: The plugin ID
getStateQuery (line 660)

Method to get a SQL query to load the published and access states for an article and category.

  • return: A database object.
  • since: 2.5
  • access: protected
JDatabaseQuery getStateQuery ()

Redefined in descendants as:
getTypeId (line 722)

Method to get the type id for the adapter content.

  • return: The numeric type id for the content.
  • since: 2.5
  • throws: Exception on database error.
  • access: protected
integer getTypeId ()
getUpdateQueryByIds (line 705)

Method to get the query clause for getting items to update by id.

  • return: A database object.
  • since: 2.5
  • access: protected
JDatabaseQuery getUpdateQueryByIds (array $ids)
  • array $ids: The ids to load.
getUpdateQueryByTime (line 687)

Method to get the query clause for getting items to update by time.

  • return: A database object.
  • since: 2.5
  • access: protected
JDatabaseQuery getUpdateQueryByTime (string $time)
  • string $time: The modified timestamp.

Redefined in descendants as:
getURL (line 747)

Method to get the URL for the item. The URL is how we look up the link in the Finder index.

  • return: The URL of the item.
  • since: 2.5
  • access: protected
string getURL (integer $id, string $extension, string $view)
  • integer $id: The id of the item.
  • string $extension: The extension the category is in.
  • string $view: The view for the URL.
index (line 309)

Method to index an item.

  • return: True on success.
  • abstract:
  • throws: Exception on database error.
  • since: 2.5
  • access: protected
boolean index (FinderIndexerResult $item)

Redefined in descendants as:
itemAccessChange (line 810)

Method to update index data on access level changes

  • since: 2.5
  • access: protected
void itemAccessChange (JTable $row)
  • JTable $row: A JTable object
itemStateChange (line 836)

Method to update index data on published state changes

  • since: 2.5
  • access: protected
void itemStateChange (array $pks, integer $value)
  • array $pks: A list of primary key ids of the content that has changed state.
  • integer $value: The value of the state that the content has been changed to.
onBeforeIndex (line 197)

Method to prepare for the indexer to be run. This method will often be used to include dependencies and things of that nature.

  • return: True on success.
  • since: 2.5
  • throws: Exception on error.
  • access: public
boolean onBeforeIndex ()
onBuildIndex (line 224)

Method to index a batch of content items. This method can be called by the indexer many times throughout the indexing process depending on how much content is available for indexing. It is important to track the progress correctly so we can display it to the user.

  • return: True on success.
  • since: 2.5
  • throws: Exception on error.
  • access: public
boolean onBuildIndex ()
onStartIndex (line 168)

Method to get the adapter state and push it into the indexer.

  • return: True on success.
  • since: 2.5
  • throws: Exception on error.
  • access: public
boolean onStartIndex ()
pluginDisable (line 872)

Method to update index data when a plugin is disabled

  • since: 2.5
  • access: protected
void pluginDisable (array $pks)
  • array $pks: A list of primary key ids of the content that has changed state.
reindex (line 321)

Method to reindex an item.

  • return: True on success.
  • since: 2.5
  • throws: Exception on database error.
  • access: protected
boolean reindex (integer $id)
  • integer $id: The ID of the item to reindex.
remove (line 343)

Method to remove an item from the index.

  • return: True on success.
  • since: 2.5
  • throws: Exception on database error.
  • access: protected
boolean remove (string $id)
  • string $id: The ID of the item to remove.
setup (line 379)

Method to setup the adapter before indexing.

  • return: True on success, false on failure.
  • abstract:
  • throws: Exception on database error.
  • since: 2.5
  • access: protected
boolean setup ()

Redefined in descendants as:
translateState (line 905)

Method to translate the native content states into states that the indexer can use.

  • return: The translated indexer state.
  • since: 2.5
  • access: protected
integer translateState (integer $item, [integer $category = null])
  • integer $item: The item state.
  • integer $category: The category state. [optional]

Inherited Methods

Inherited From JPlugin

 JPlugin::__construct()
 JPlugin::loadLanguage()

Inherited From JEvent

 JEvent::__construct()
 JEvent::update()

Inherited From JObject

 JObject::__construct()
 JObject::def()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::__toString()

Documentation generated on Tue, 19 Nov 2013 14:53:24 +0100 by phpDocumentor 1.4.3