Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
FilterDAO Class Reference
Inheritance diagram for FilterDAO:
DAO

Public Member Functions

 _deleteSubFiltersByParentFilterId (&$parentFilterId)
 
_fromRow (&$row)
 
 _insertSubFilters (&$parentFilter)
 
_newDataObject ($filterClassName, $filterGroupId)
 
 _populateSubFilters (&$parentFilter)
 
configureObject ($filterClassName, $filterGroupSymbolic, $settings=array(), $asTemplate=false, $contextId=0, $subFilters=array(), $persist=true)
 
 deleteObject (&$filter)
 
 deleteObjectById ($filterId)
 
 FilterDAO ()
 
 getAdditionalFieldNames ()
 
 getInsertId ()
 
 getLocaleFieldNames ()
 
getObject (&$filter)
 
getObjectById ($filterId, $allowSubfilter=false)
 
getObjectsByClass ($className, $contextId=CONTEXT_ID_NONE, $getTemplates=false, $allowSubfilters=false)
 
getObjectsByGroup ($groupSymbolic, $contextId=CONTEXT_ID_NONE, $getTemplates=false, $checkRuntimeEnvironment=true)
 
getObjectsByGroupAndClass ($groupSymbolic, $className, $contextId=CONTEXT_ID_NONE, $getTemplates=false, $allowSubfilters=false)
 
getObjectsByTypeDescription ($inputTypeDescription, $outputTypeDescription, $data=null, $dataIsInput=true)
 
 insertObject (&$filter, $contextId=CONTEXT_ID_NONE)
 
 updateDataObjectSettings ($tableName, &$dataObject, $idArray)
 
 updateObject (&$filter)
 
- Public Member Functions inherited from DAO
 concat ()
 
 convertFromDB ($value, $type)
 
 convertToDB ($value, &$type)
 
 DAO ($dataSource=null, $callHooks=true)
 
 dateFromDB ($d)
 
 datetimeFromDB ($dt)
 
 datetimeToDB ($dt)
 
 dateToDB ($d)
 
 flushCache ()
 
 formatDateToDB ($date, $defaultNumWeeks=null, $acceptPastDate=true)
 
 getAffectedRows ()
 
 getDataChangedEvent ($elementId=null, $parentElementId=null)
 
getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getInsertId ($table= '', $id= '', $callHooks=true)
 
 getType ($value)
 
 replace ($table, $arrFields, $keyCols)
 
retrieve ($sql, $params=false, $callHooks=true)
 
retrieveCached ($sql, $params=false, $secsToCache=3600, $callHooks=true)
 
retrieveLimit ($sql, $params=false, $numRows=false, $offset=false, $callHooks=true)
 
retrieveRange ($sql, $params=false, $dbResultRange=null, $callHooks=true)
 
 setCacheDir ()
 
 setDataSource (&$dataSource)
 
 update ($sql, $params=false, $callHooks=true, $dieOnError=true)
 
 updateDataObjectSettings ($tableName, &$dataObject, $idArray)
 

Additional Inherited Members

- Public Attributes inherited from DAO
 $_dataSource
 

Detailed Description

Operations for retrieving and modifying Filter objects.

See Also
PersistableFilter

The filter DAO acts as a filter registry. It allows filter providers to register transformations and filter consumers to identify available transformations that convert a given input type into a required output type.

Transformations are defined as a combination of a filter class, a pair of input/output type specifications supported by that filter implementation and a set of configuration parameters that customize the filter.

Transformations can be based on filter templates. A template is defined as a filter instance without parameterization. A flag is used to distinguish filter templates from fully parameterized filter instances.

Different filters that perform semantically related transformations (e.g. all citation parsers or all citation output filters) are clustered into filter groups (

See Also
FilterGroup).

The following additional conditions apply: 1) A single filter class may support several transformations, i.e. distinct combinations of input and output types or distinct parameterizations. Therefore the filter DAO must be able to handle several registry entries per filter class. 2) The DAO must take care to only select such transformations that are supported by the current runtime environment. 3) The DAO implementation must be scalable, fast and memory efficient.

Definition at line 44 of file FilterDAO.inc.php.

Member Function Documentation

FilterDAO::_deleteSubFiltersByParentFilterId ( $parentFilterId)

Recursively delete all sub-filters for the given parent filter.

Parameters
$parentFilterIdinteger

Definition at line 579 of file FilterDAO.inc.php.

References deleteObjectById(), and DAO\retrieve().

Referenced by deleteObjectById(), and updateObject().

& FilterDAO::_fromRow ( $row)

Internal function to return a filter instance (transformation) object from a row.

Parameters
$rowarray
Returns
PersistableFilter

Definition at line 487 of file FilterDAO.inc.php.

References _newDataObject(), and _populateSubFilters().

Referenced by getObjectById(), and getObjectsByGroup().

FilterDAO::_insertSubFilters ( $parentFilter)

Recursively insert sub-filters of the given parent filter.

Parameters
$parentFilterFilter

Definition at line 559 of file FilterDAO.inc.php.

References insertObject().

Referenced by insertObject(), and updateObject().

& FilterDAO::_newDataObject (   $filterClassName,
  $filterGroupId 
)

Construct a new configured filter instance (transformation).

Parameters
$filterClassNamestring a fully qualified class name
$filterGroupIdinteger
Returns
PersistableFilter

Definition at line 467 of file FilterDAO.inc.php.

References DAORegistry\getDAO().

Referenced by _fromRow().

FilterDAO::_populateSubFilters ( $parentFilter)

Populate the sub-filters (if any) for the given parent filter.

Parameters
$parentFilterPersistableFilter

Definition at line 525 of file FilterDAO.inc.php.

References DAO\retrieve().

Referenced by _fromRow().

& FilterDAO::configureObject (   $filterClassName,
  $filterGroupSymbolic,
  $settings = array(),
  $asTemplate = false,
  $contextId = 0,
  $subFilters = array(),
  $persist = true 
)

Instantiates a new filter from configuration data and then installs it.

Parameters
$filterClassNamestring
$filterGroupSymbolicstring
$settingsarray key-value pairs that can be directly written via DataObject::setData().
$asTemplateboolean
$contextIdinteger the context the filter should be installed into
$subFiltersarray sub-filters (only allowed when the filter is a CompositeFilter)
$persistboolean whether to actually persist the filter
Returns
PersistableFilter|boolean the new filter if installation successful, otherwise 'false'.

Definition at line 72 of file FilterDAO.inc.php.

References DAORegistry\getDAO(), and insertObject().

FilterDAO::deleteObject ( $filter)

Delete a filter instance (transformation).

Parameters
$filterPersistableFilter
Returns
boolean

Definition at line 384 of file FilterDAO.inc.php.

References deleteObjectById().

FilterDAO::deleteObjectById (   $filterId)

Delete a filter instance (transformation) by id.

Parameters
$filterIdint
Returns
boolean

Definition at line 393 of file FilterDAO.inc.php.

References _deleteSubFiltersByParentFilterId(), and DAO\update().

Referenced by _deleteSubFiltersByParentFilterId(), and deleteObject().

FilterDAO::FilterDAO ( )

Constructor

Definition at line 54 of file FilterDAO.inc.php.

FilterDAO::getAdditionalFieldNames ( )
See Also
DAO::getAdditionalFieldNames()

Definition at line 432 of file FilterDAO.inc.php.

FilterDAO::getInsertId ( )

Get the ID of the last inserted filter instance (transformation).

Returns
int

Definition at line 453 of file FilterDAO.inc.php.

Referenced by insertObject().

FilterDAO::getLocaleFieldNames ( )
See Also
DAO::getLocaleFieldNames()

Definition at line 440 of file FilterDAO.inc.php.

& FilterDAO::getObject ( $filter)

Retrieve a configured filter instance (transformation)

Parameters
$filterPersistableFilter
Returns
PersistableFilter

Definition at line 154 of file FilterDAO.inc.php.

References getObjectById().

& FilterDAO::getObjectById (   $filterId,
  $allowSubfilter = false 
)

Retrieve a configured filter instance (transformation) by id.

Parameters
$filterIdinteger
$allowSubfilterboolean
Returns
PersistableFilter

Definition at line 164 of file FilterDAO.inc.php.

References _fromRow(), and DAO\retrieve().

Referenced by getObject().

& FilterDAO::getObjectsByClass (   $className,
  $contextId = CONTEXT_ID_NONE,
  $getTemplates = false,
  $allowSubfilters = false 
)

Retrieve a result set with all filter instances (transformations) that are based on the given class.

Parameters
$classNamestring
$contextIdinteger
$getTemplatesboolean set true if you want filter templates rather than actual transformations
$allowSubfiltersboolean
Returns
DAOResultFactory

Definition at line 193 of file FilterDAO.inc.php.

References DAO\retrieve().

& FilterDAO::getObjectsByGroup (   $groupSymbolic,
  $contextId = CONTEXT_ID_NONE,
  $getTemplates = false,
  $checkRuntimeEnvironment = true 
)

Retrieve filter instances configured for a given context that belong to a given filter group.

Only filters supported by the current run-time environment will be returned when $checkRuntimeEnvironment is set to 'true'.

Parameters
$groupSymbolicstring
$contextIdinteger returns filters from context 0 and the given filters of all contexts if set to null
$getTemplatesboolean set true if you want filter templates rather than actual transformations
$checkRuntimeEnvironmentboolean whether to remove filters from the result set that do not match the current run-time environment.
Returns
array filter instances (transformations) in the given group

Definition at line 310 of file FilterDAO.inc.php.

References _fromRow(), and DAO\retrieve().

& FilterDAO::getObjectsByGroupAndClass (   $groupSymbolic,
  $className,
  $contextId = CONTEXT_ID_NONE,
  $getTemplates = false,
  $allowSubfilters = false 
)

Retrieve a result set with all filter instances (transformations) within a given group that are based on the given class.

Parameters
$groupSymbolicstring
$classNamestring
$contextIdinteger
$getTemplatesboolean set true if you want filter templates rather than actual transformations
$allowSubfiltersboolean
Returns
DAOResultFactory

Definition at line 219 of file FilterDAO.inc.php.

References DAO\retrieve().

& FilterDAO::getObjectsByTypeDescription (   $inputTypeDescription,
  $outputTypeDescription,
  $data = null,
  $dataIsInput = true 
)

Retrieve filters based on the supported input/output type.

Parameters
$inputTypeDescriptiona type description that has to match the input type
$outputTypeDescriptiona type description that has to match the output type NB: input and output type description can contain wildcards.
$datamixed the data to be matched by the filter. If no data is given then all filters will be matched.
$dataIsInputboolean true if the given data object is to be checked as input type, false to check against the output type.
Returns
array a list of matched filters.

Definition at line 245 of file FilterDAO.inc.php.

References DAO\retrieve().

FilterDAO::insertObject ( $filter,
  $contextId = CONTEXT_ID_NONE 
)

Insert a new filter instance (transformation).

Parameters
$filterPersistableFilter The configured filter instance to be persisted
$contextIdinteger
Returns
integer the new filter id

Definition at line 119 of file FilterDAO.inc.php.

References _insertSubFilters(), getInsertId(), DAO\update(), and updateDataObjectSettings().

Referenced by _insertSubFilters(), and configureObject().

FilterDAO::updateDataObjectSettings (   $tableName,
$dataObject,
  $idArray 
)
See Also
DAO::updateDataObjectSettings()

Definition at line 408 of file FilterDAO.inc.php.

Referenced by insertObject(), and updateObject().

FilterDAO::updateObject ( $filter)

Update an existing filter instance (transformation).

Parameters
$filterPersistableFilter

Definition at line 341 of file FilterDAO.inc.php.

References _deleteSubFiltersByParentFilterId(), _insertSubFilters(), DAO\update(), and updateDataObjectSettings().


The documentation for this class was generated from the following file: