293 Commits

Author SHA1 Message Date
Johannes Meyer
f2ad2838f4 ArrayDatasource: Apply a query's limit and offset when creating the result 2015-05-06 09:39:43 +02:00
Johannes Meyer
d63381c002 ArrayDatasource: Add missing and fix existing documentation 2015-05-06 09:12:48 +02:00
Johannes Meyer
b1cbc1422b ArrayDatasource: Add support for associative arrays
Keys are now preserved in case a non-numeric one is found. By using
setKeyColumn() it is now also possible to map such a key to a specific
column of a row generated by createResult().
2015-05-06 08:40:02 +02:00
Johannes Meyer
5cc7f26728 ConfigObject: Extend ArrayDatasource
This makes it possible to use a ini file as repository!!!1
One thing is missing: Section names are currently ignored and should be
mapped to a virtual column.

refs #8826
2015-05-05 15:21:34 +02:00
Johannes Meyer
bd136d39f4 SimpleQuery: Make compare() alias aware
refs #8826
refs #7693
2015-05-05 07:31:50 +02:00
Johannes Meyer
d71df6a9b8 Revert "SimpleQuery: Make compare() alias aware"
This reverts commit 6612e4c1ae79c2bc3a5cd08e1594fc152107618e.
2015-05-05 07:30:42 +02:00
Johannes Meyer
6612e4c1ae SimpleQuery: Make compare() alias aware
refs #8826
refs #7693
2015-05-04 11:34:39 +02:00
Johannes Meyer
ecd059dec5 DbConnection: select() returns a DbQuery, not a Query 2015-05-04 11:13:38 +02:00
Johannes Meyer
e7789ed640 SimpleQuery: Rename unused property table' to target'
`target' is already in use, but was not declared. `table' was declared but not
used anywhere. So `table' is now `target'.
2015-05-04 11:12:43 +02:00
Johannes Meyer
ca5ef2da2b Merge Queryable into QueryInterface
A *Query*Interface describes an object as being queryable, now.

refs #8826
2015-05-04 11:07:50 +02:00
Johannes Meyer
97caeb27f7 UserBackend: Add missing and fix existing method documentation
refs #8826
2015-04-21 13:59:35 +02:00
Eric Lippmann
45d1230b28 Merge branch 'master' into bugfix/significant-whitespaces-8777 2015-04-08 10:19:53 +02:00
Eric Lippmann
6e6aabedf2 Don't trim filter expressions
Leading and trailing whitespaces may be significant for comparison.

refs #8777
2015-04-08 09:31:11 +02:00
Alexander Klimov
967a2e82dc Use (only) "@return $this" in fluent interfaces' documentation 2015-04-07 14:24:11 +02:00
Eric Lippmann
949438d753 lib: Add SimpleQuery::splitOrder() ...
... for supporting specifying the sort direction next to the column, e.g.
'service_display_name ASC'

refs #8716
2015-03-13 17:09:32 +01:00
Eric Lippmann
8563d5ed3f PHPDoc: Use @var instead of @type
Becasue of too many kittens PSR-5 backed off of deprecating @var.
So that's the way we go too.
2015-03-12 16:08:47 +01:00
Eric Lippmann
760819f239 lib: Remove TreeNode::getIterator()
Its the tree who has the iterator.

refs #6630
2015-02-10 17:01:32 +01:00
Eric Lippmann
b18405e99f lib: Add SimpleTree
Simple tree implementation for TreeNodes.

refs #6630
2015-02-10 17:00:47 +01:00
Eric Lippmann
fd38e5b2e1 lib: Use @inheritdoc in the TreeNodeIterator
refs #6630
2015-02-10 16:59:43 +01:00
Eric Lippmann
3a4c6e45b8 Fix Fatal error: Interface 'Identifiable' not found
refs #6630
2015-02-06 17:32:51 +01:00
Eric Lippmann
0d63e14baf lib: Rename Node to TreeNode
refs #6630
2015-02-06 17:27:14 +01:00
Eric Lippmann
828cb8d23a lib: Add iterator over a tree node's children
refs #6630
2015-02-06 17:23:07 +01:00
Eric Lippmann
f331c03f63 lib/tree: Save child nodes into an array instead of using SplDoublyLinkedList
refs #6630
2015-02-06 17:20:23 +01:00
Eric Lippmann
c8da05d0a7 lib: Remove NodeInterface
I'll create an iterator for nodes and drop that every node is a SplDoublyLinkedList.

refs #6630
2015-02-06 17:17:41 +01:00
Eric Lippmann
6bae2e0a53 Note that our license is GPL v2 or any later version in our license header instead of pointing to the license's URL 2015-02-04 10:52:27 +01:00
Eric Lippmann
5b4fab0750 Add license header
This time without syntax errors hopefully :)
2015-02-03 16:27:59 +01:00
Eric Lippmann
5fa2e3cfdc Revert "Add license header"
This reverts commit 338d067aba41dd6e9178cebec5433eecd614196e.
2015-02-03 16:16:26 +01:00
Eric Lippmann
338d067aba Add license header
fixes #7788
2015-02-03 15:51:04 +01:00
Eric Lippmann
52c40bdc5b lib/SimpleQuery: Increase default limit to 25
Please follow the referenced issues.

fixes #8337
refs #8339
2015-02-02 14:16:27 +01:00
Eric Lippmann
c53b1d27e9 lib: Deprecate Data\Filterable because of ...
addFilter and applyFilter do the same in all usages.
addFilter could be replaced w/ getFilter()->add().
We must no require classes implementing this interface to implement redundant methods over and over again.
The interface must be moved to the namespace Icinga\Data\Filter.
It lacks documentation.
2015-01-27 14:33:46 +01:00
Johannes Meyer
38957e340b Fix that DbQuery::renderFilter produces invalid filters
fixes #7749
2014-11-20 11:58:22 +01:00
Johannes Meyer
7621f6642d Adjust usages of Icinga\Application\Config
refs #7147
2014-11-18 13:11:52 +01:00
Johannes Meyer
0c84bf614d Split config functionality into two classes
There is now Icinga\Application\Config as our ini configuration handler and
Icinga\Data\ConfigObject as our general configuration container.

refs #7147
2014-11-18 13:02:56 +01:00
Thomas Gelf
40c4562fe4 Data\SimpleQuery: don't fail on missing columns...
...for now
2014-11-16 18:24:16 +01:00
Thomas Gelf
b2a55f0998 Db\DbQuery: do not expose applyFilterSql 2014-11-16 17:09:51 +01:00
Thomas Gelf
5ea2f33efb Db\DbQuery: add NOT LIKE support 2014-11-16 17:08:50 +01:00
Thomas Gelf
90f1ab06b4 Db\DbQuery: add "deep" clone support
Still far from being complete, Zend_Db_Select makes life really hard for
us. More to come...
2014-11-16 17:06:26 +01:00
Thomas Gelf
e89d4642e3 Merge remote-tracking branch 'origin/master' into feature/livestatus-playground-4787 2014-11-16 10:12:34 +01:00
Thomas Gelf
9e0e3f12e3 FilterChain: addFilter should return itself 2014-11-16 02:49:33 +01:00
Thomas Gelf
44c96f0410 FilterOr: override operator change for NOT
Replacing an OR filter with a NOT operator should return a NOT OR
when the OR contains more than one entry
2014-11-15 22:37:12 +01:00
Thomas Gelf
1f74c462d4 FilterChain: add and use count() function 2014-11-15 22:34:18 +01:00
Thomas Gelf
925348d171 Data\Filter: add or/andFilter implementations
Those shortcuts make it easy to correctly add or/and conditions
regardless of the original filter type
2014-11-14 23:06:20 +01:00
Thomas Gelf
6aefc4b491 Data\Filter: fix $self VS $this 2014-11-14 22:53:46 +01:00
Thomas Gelf
178ddaade7 Data\Filter: add missing abstract function type 2014-11-14 22:44:04 +01:00
Thomas Gelf
53bca911fb Data\Filter: enforce isEmpty() implementation 2014-11-14 22:43:30 +01:00
Thomas Gelf
ce7aea5df7 Data\Filter: add isChain() and isExpression()
This makes node type distiction easier
2014-11-14 22:41:30 +01:00
Eric Lippmann
94f8597271 Add existing GROUPBYs to count queries 2014-11-13 16:42:11 +01:00
Eric Lippmann
0e34001568 Use automatically a subquery when counting with groups 2014-11-13 16:42:11 +01:00
Johannes Meyer
77f5bc3932 Use GROUPBY instead of DISTINCT and subqueries when counting 2014-11-13 16:42:11 +01:00
Thomas Gelf
f0ca81d7af Data\Filter: SORT_NATURAL only for PHP >= 5.4 2014-11-12 11:47:42 +01:00