From 45419606077dca7a5ce99d11f04bc1803d147ae7 Mon Sep 17 00:00:00 2001 From: icewing Date: Wed, 4 Jun 2008 10:27:47 +0000 Subject: Marcus Povey * More documentation added git-svn-id: https://code.elgg.org/elgg/trunk@786 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/query.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/engine/lib/query.php b/engine/lib/query.php index 8b6df5c8b..6606a7cc8 100644 --- a/engine/lib/query.php +++ b/engine/lib/query.php @@ -481,28 +481,78 @@ $this->setQueryType(new SelectQueryTypeQueryComponent()); } + /** + * Add limits and offsets to the query. + * + * @param LimitOffsetQueryComponent $component The limit and offset. + */ public function setLimitAndOffset(LimitOffsetQueryComponent $component) { $this->limit_and_offset = $component; } + /** + * Reset and set the field to the select statement. + * + * @param SelectFieldQueryComponent $component Table and field component. + */ public function setSelectField(SelectFieldQueryComponent $component) { $this->fields = array(); return $this->addSelectField($component); } + /** + * Add a select field. + * + * @param SelectFieldQueryComponent $component Add a component. + */ public function addSelectField(SelectFieldQueryComponent $component) { $this->fields[] = $component; } + /** + * Add a join to the component. + * + * @param JoinQueryComponent $component The join. + */ public function addJoin(JoinQueryComponent $component) { $this->joins[] = $component; } + /** + * Set a field value in an update or insert statement. + * + * @param SetQueryComponent $component Fields to set. + */ public function addSet(SetQueryComponent $component) { $this->sets[] = $component; } + /** + * Set the query type, i.e. "select", "update", "insert" & "delete". + * + * @param QueryTypeQueryComponent $component The query type. + */ public function setQueryType(QueryTypeQueryComponent $component) { $this->query_type = $component; } + /** + * Attach an order component. + * + * @param OrderQueryComponent $component The order component. + */ public function setOrder(OrderQueryComponent $component) { $this->order = $component; } + /** + * Add a table to the query. + * + * @param TableQueryComponent $component Table to add. + */ public function addTable(TableQueryComponent $component) { $this->tables[] = $component; } + /** + * Add a where clause to the query. + * + * @param WhereQueryComponent $component The where component + */ public function addWhere(WhereQueryComponent $component) { $this->where[] = $component; } + /** + * Set access control. + * + * @param AccessControlQueryComponent $component Access control. + */ public function setAccessControl(AccessControlQueryComponent $component) { $this->access_control = $component; } public function __toString() -- cgit v1.2.3