Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
Introduce Controller\MetaFilterApi #56
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaber-de committed Feb 15, 2016
1 parent bb3fdc3 commit 0b1903c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
54 changes: 54 additions & 0 deletions inc/Controller/MetaFilterApi.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php # -*- coding: utf-8 -*-

namespace W2M\Controller;

use
W2M\Import\Data;

/**
* Class MetaFilterApi
*
* Applies w2m_import_meta_filter to the meta filter list to allow
* third party code to adapt the filters.
*
* @package W2M\Controller
*/
class MetaFilterApi {

/**
* @var Data\MetaFilterListInterface
*/
private $filter_list;

private $postponed_filter_list;

/**
* @param Data\MetaFilterListInterface $filter_list
* @param $postponed_filter_list (Todo: specify implement this)
*/
public function __construct(
Data\MetaFilterListInterface $filter_list,
$postponed_filter_list = NULL
) {

$this->filter_list = $filter_list;
$this->postponed_filter_list = $postponed_filter_list;
}

/**
* Applies w2m_import_meta_filter to the meta filter list to allow
* third party code to adapt the filters.
*/
public function register_filter() {

/**
* Use this hook to register filters to specific meta keys for specific
* element types
*
* @see \W2M\Import\Filter\ValueFilterableInterface
*
* @param Data\MetaFilterListInterface
*/
do_action( 'w2m_import_meta_filter', $this->filter_list );
}
}
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Use the installer via back-end of your install or ...
* `w2m_import_term_ancestor_resolving_start` in `W2M\Import\Module\ResolvingPendingRelations::resolving_terms()`

* `w2m_import_meta_not_filterable` in `W2M\Import\Filter\ImportMetaFilter::filter_value()`
* `w2m_import_meta_filter` in `W2M\Controller\MetaFilterApi::register_filter()`


## Other Notes
Expand Down

0 comments on commit 0b1903c

Please sign in to comment.