Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper meta data for filters #20

Merged
merged 5 commits into from
Mar 19, 2021
Merged

Conversation

nilmerg
Copy link
Member

@nilmerg nilmerg commented Mar 17, 2021

The Properties trait is not really what I imagined for filter meta data. Meta data, by definition, only consists of additional data that is not significant to how whatever it is related to, works. So it needs to be a separate object/interface. A separate interface is also one of the flaws I'd see of the Properties trait. When handling/defining filter meta data, I'd expect to be able to quickly identify the usages of said meta data. This doesn't work with dynamic anonymous properties.

This introduces the class ipl\Stdlib\Data which is more of a generic container for data. (Similar to the ConfigObject of Icinga Web 2)
Classes ipl\Stdlib\Filter\Chain and ipl\Stdlib\Filter\Condition implement a new interface ipl\Stdlib\Filter\MetaDataProvider.

General usage:

$rule->metaData()->has('columnLabel');
$rule->metaData()->set('columnLabel', 'Host Name');
$rule->metaData()->get('columnLabel');

nilmerg added a commit to Icinga/ipl-orm that referenced this pull request Mar 17, 2021
@nilmerg nilmerg force-pushed the proper-meta-data-for-filters branch 2 times, most recently from 8917e75 to 9fed07e Compare March 18, 2021 08:47
@nilmerg nilmerg force-pushed the proper-meta-data-for-filters branch from 9fed07e to 08361ef Compare March 19, 2021 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant