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 25)

JObject
   |
   --JEvent
      |
      --JPlugin
         |
         --FinderIndexerAdapter
Direct descendents
Class Description
plgFinderWeblinks Finder adapter for Joomla Web Links.
plgFinderContacts Finder adapter for Joomla Contacts.
plgFinderContent Finder adapter for com_content.
plgFinderNewsfeeds Finder adapter for Joomla Newsfeeds.
plgFinderCategories Finder adapter for Joomla Categories.
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 $sql = null])
JDatabaseQuery getListQuery ([mixed $sql = 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 36)

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 100)

The database object.

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

The extension name.

  • since: 2.5
  • access: protected

Redefined in descendants as:
string $layout (line 52)

The sublayout to use when rendering the results.

  • since: 2.5
  • access: protected

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

The mime type of the content the adapter indexes.

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

The access level of an item before save.

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

The access level of a category before save.

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

The field the published state is stored in.

  • since: 2.5
  • access: protected

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

The table name.

  • since: 2.5
  • access: protected

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

The type id of the content.

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

The type of content the adapter indexes.

  • since: 2.5
  • access: protected

Redefined in descendants as:

Inherited Variables

Inherited from JPlugin

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

Inherited from JEvent

JEvent::$_subject

Inherited from JObject

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

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

Redefined in descendants as:
categoryAccessChange (line 403)

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 436)

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 272)

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 474)

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 495)

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 515)

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 563)

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 813)

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 606)

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 $sql = null])
  • integer $offset: The list offset.
  • integer $limit: The list limit.
  • JDatabaseQuery $sql: A JDatabaseQuery object. [optional]
getListQuery (line 660)

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 $sql = null])
  • mixed $sql: A JDatabaseQuery object. [optional]

Redefined in descendants as:
getPluginType (line 679)

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 700)

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 763)

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 744)

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 724)

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 797)

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 313)

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 869)

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 895)

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 188)

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 217)

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 158)

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 929)

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 325)

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 347)

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 392)

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 962)

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()
JObject::__toString()

Documentation generated on Mon, 25 Jun 2012 13:52:05 -0500 by phpDocumentor 1.4.4