From b8561385f590fbc798efd733b43aa67ab84b40f0 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 22 Feb 2017 20:29:17 +0100 Subject: [PATCH] Add docblocks --- DataStorage/Database/Query/Builder.php | 30 ++++++++++++++++++++++++-- Message/Http/Request.php | 8 +++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/DataStorage/Database/Query/Builder.php b/DataStorage/Database/Query/Builder.php index 15379a187..349fda71b 100644 --- a/DataStorage/Database/Query/Builder.php +++ b/DataStorage/Database/Query/Builder.php @@ -493,16 +493,42 @@ class Builder extends BuilderAbstract return $this; } - public function getWhereByColumn($column) + /** + * Get column of where condition + * + * One column can have multiple where conditions. + * TODO: maybe think about a case where there is a where condition but no column but some other identifier? + * + * @param mixed $column Column + * + * @return array|null + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getWhereByColumn($column) /* : ?array */ { return $this->wheres[self::getPublicColumnName($column)] ?? null; } - public function getTableOfSystem($expression, $systemIdentifier) + /** + * Get table name of system + * + * @param mixed $expression System expression + * @param string $systemIdentifier System identifier + * + * @return string|null + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getTableOfSystem($expression, string $systemIdentifier) /* : ?string */ { if(($pos = strpos($expression, $systemIdentifier . '.' . $systemIdentifier)) === false) { return null; } + + return explode('.', $expression)[0]; } /** diff --git a/Message/Http/Request.php b/Message/Http/Request.php index 8f474a1f5..2c4d040d4 100644 --- a/Message/Http/Request.php +++ b/Message/Http/Request.php @@ -154,6 +154,14 @@ class Request extends RequestAbstract $this->uri = $this->uri ?? new Http(Http::getCurrent()); } + /** + * Load request language + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ private function loadRequestLanguage() : string { $lang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];