Commit Graph

41 Commits

Author SHA1 Message Date
Johannes Meyer b397b01966 DbRepository: Avoid to overwrite foreign keys in $aliasTableMap and $aliasColumnMap 2017-07-06 14:10:15 +02:00
Johannes Meyer 46647444c4 Repository: Fix broken conversion rules
The additional layers in $aliasTableMap and $aliasColumnMap required
for DbRepository's join probabilities are now only established there.
2017-06-20 08:32:44 +02:00
Johannes Meyer 91b0e98171 DbRepository: Allow to pass parameter $types to methods insert() and update()
DbConnection does already support this but it got somehow forgotten in this
class.
2017-06-06 09:48:40 +02:00
Johannes Meyer 29f9ff5ce0 DbRepository: Fix that virtual tables are not resolved when issuing statements 2017-06-06 09:33:06 +02:00
Johannes Meyer b8ae738f7f DbRepository: Add support for join probabilities
Finally solves the issue with those nasty column prefixes..
2017-06-06 09:29:05 +02:00
Johannes Meyer 7482a34b45 Repository: Check prefixed aliases earlier when inspecting $aliasTableMap
Avoids false-positives in case an exact match using $columnTableMap is
possible, though $aliasTableMap holds a prefixed entry.
2017-06-06 09:24:56 +02:00
Johannes Meyer b2d86df660 DbRepository: Fix that virtual tables are not resolved for statement columns 2017-05-30 13:57:58 +02:00
Johannes Meyer 181e2ef05c Swag: Fix swag (aka a whole bunch of code style issues..) 2017-01-27 14:48:59 +01:00
Alexander A. Klimov 474803fee4 Change all license headers to only reflect a file's year of creation
refs #11000
2016-02-08 15:41:00 +01:00
Eric Lippmann 7fd575080e PHP7: Rename String to StringHelper
refs #10251
2016-01-27 16:46:55 +01:00
Johannes Meyer d527ac2717 DbRepository: Handle columns of type Zend_Db_Expr #3 2015-12-07 12:06:27 +01:00
Johannes Meyer 64f13f0512 DbRepository: Handle columns of type Zend_Db_Expr #2 2015-12-07 09:55:25 +01:00
Johannes Meyer 0d1d3c3b8f DbRepository: Handle columns of type Zend_Db_Expr 2015-12-04 08:22:48 +01:00
Johannes Meyer dc7756c599 DbRepository: Fix that PostgreSQL queries do not apply LOWER on order cols
refs #10364
refs #9955
2015-11-12 09:13:46 +01:00
Johannes Meyer 439fc28d0f DbRepository: Add missing use statement for class FilterExpression
refs #10364
2015-11-12 08:23:35 +01:00
Johannes Meyer d2b8ed243f Repository: Accept parameter $filter in method requireFiltercolumn()
This allows to adjust more than the name of the column if necessary.

refs #10364
2015-11-11 16:05:54 +01:00
Johannes Meyer 22f966db43 DbRepository: Fix that PostgreSQL queries use LOWER() on non-CI columns
refs #10364
refs #9954
2015-11-11 15:06:18 +01:00
Johannes Meyer dd069288e9 DbRepository: Do not attempt to join virtual tables multiple times 2015-11-04 15:59:40 +01:00
Johannes Meyer 71c5fd0bf7 DbRepository: Take virtual columns into consideration when applying aliases 2015-11-02 17:07:02 +01:00
Johannes Meyer a60ad3ecf0 DbRepository: Return the number of affected rows for cud operations 2015-10-30 15:34:57 +01:00
Johannes Meyer 58fc87b2e5 Repository: Ensure that we'll internally only work with virtual table names
refs #10367
2015-10-16 14:46:44 +02:00
Johannes Meyer 7ef76932d4 DbRepository: Validate the table when inserting, updating and deleting 2015-10-16 12:36:47 +02:00
Johannes Meyer caca219aa1 DbRepository: Consider table aliases while handling statement columns
Usually not required as there are no aliases for statements possible
but since we cannot differentiate everywhere what type of column
we're processing it is safer to always handle such.

fixes #9553
2015-07-03 13:06:10 +02:00
Johannes Meyer 5d3eb5e8cb Repository: Allow to check for conversion rules of a specific column 2015-06-26 14:20:35 +02:00
Johannes Meyer 4ba84903f1 Repository: Accept already resolved columns as well
If a column was aliased, one was required to use the alias when
selecting, sorting or filtering. This is now not necessary anymore
as it's now possible to use the actual column name as well.
2015-06-26 13:07:21 +02:00
Johannes Meyer beb5bd7370 Repository: Clone a filter implicitly in self::requireFilter($clone = true)
refs #8826
2015-06-01 15:03:08 +02:00
Johannes Meyer c8e8a39f5a DbRepository: Relax check in providesValueConversion()
Would otherwise conflict when tables are joined in.

refs #8826
2015-05-29 11:58:21 +02:00
Johannes Meyer b82d7d7cc0 DbRepository: split() is deprecated, use explode() instead
Why php, why? :'(

refs #8826
2015-05-29 11:37:42 +02:00
Johannes Meyer bb285db05b Differentiate the source or destination of a column when converting values
refs #8826
2015-05-29 11:32:15 +02:00
Johannes Meyer 5e0ae6410b DbRepository: Consider a filter column without query context as a statement column
Feels wrong..somehow, but it works.

refs #8826
2015-05-29 08:02:12 +02:00
Johannes Meyer 08f8fe6f49 DbRepository: Add support for joining tables based on query/filter columns
refs #8826
2015-05-28 13:53:49 +02:00
Johannes Meyer 5326ce6bca DbRepository: Add support for table specific aliases
This was previously only possible for the base table and in case one wanted
to use table aliases in the query column definition for non-base tables as
well, it did not work well due to not being explicitly supported. Now, to use
such table aliases one must initialize DbRepository::tableAliases.

refs #8826
2015-05-28 13:44:51 +02:00
Johannes Meyer 647dd9d425 RepositoryQuery: Pass through the query when requiring a table or column
This allows now to adjust the query in custom repository implementations.

refs #8826
2015-05-28 13:25:26 +02:00
Johannes Meyer 23b7ab0764 DbRepository: Remove COLLATE from a query column in case of a pgsql connection
refs #8826
2015-05-27 11:47:18 +02:00
Johannes Meyer 4833ff109c RepositoryQuery: Validate the table passed when calling from()
refs #8826
2015-05-21 15:01:13 +02:00
Johannes Meyer 0dda19dc7a DbRepository: Remove the table prefix when resolving statement columns
refs #8826
2015-05-20 11:50:09 +02:00
Johannes Meyer e9fee2dad6 Repository: Handle column name ambiguousness automatically
refs #8826
2015-05-13 13:27:08 +02:00
Johannes Meyer 7d982068a5 DbRepository: Ensure that we'll work with a instance of DbConnection
refs #8826
2015-05-13 09:52:29 +02:00
Johannes Meyer 053c9cdcb3 Repository: Check whether a column is queried from the correct table
refs #8826
2015-05-12 15:38:29 +02:00
Johannes Meyer ca166b0175 DbRepository: Add insert, update and delete capabilities
refs #8826
2015-05-11 13:26:41 +02:00
Johannes Meyer 870e75c99c Introduce class Icinga\Repository\DbRepository
refs #8826
2015-05-04 11:39:12 +02:00