diff --git a/manual/codes/DQL (Doctrine Query Language) - DELETE queries.php b/manual/codes/DQL (Doctrine Query Language) - DELETE queries.php new file mode 100644 index 000000000..79a1e433e --- /dev/null +++ b/manual/codes/DQL (Doctrine Query Language) - DELETE queries.php @@ -0,0 +1,15 @@ + ?'; + +$rows = $this->conn->query($q, array(3)); + +// the same query using the query interface + +$q = new Doctrine_Query(); + +$rows = $q->update('Account') + ->where('id > ?') + ->execute(array(3)); + +print $rows; // the number of affected rows +?> diff --git a/manual/codes/DQL (Doctrine Query Language) - UPDATE queries.php b/manual/codes/DQL (Doctrine Query Language) - UPDATE queries.php new file mode 100644 index 000000000..0deaeff90 --- /dev/null +++ b/manual/codes/DQL (Doctrine Query Language) - UPDATE queries.php @@ -0,0 +1,16 @@ + 200'; + +$rows = $this->conn->query($q); + +// the same query using the query interface + +$q = new Doctrine_Query(); + +$rows = $q->update('Account') + ->set('amount', 'amount + 200') + ->where('id > 200') + ->execute(); + +print $rows; // the number of affected rows +?> diff --git a/manual/docs/DQL (Doctrine Query Language) - DELETE queries.php b/manual/docs/DQL (Doctrine Query Language) - DELETE queries.php new file mode 100644 index 000000000..357dfd51f --- /dev/null +++ b/manual/docs/DQL (Doctrine Query Language) - DELETE queries.php @@ -0,0 +1,20 @@ +
+
+DELETE FROM component_name
+    [WHERE where_condition]
+    [ORDER BY ...]
+    [LIMIT record_count]
+
+
+ diff --git a/manual/docs/DQL (Doctrine Query Language) - Introduction.php b/manual/docs/DQL (Doctrine Query Language) - Introduction.php index faa29ca83..c45e19ff6 100644 --- a/manual/docs/DQL (Doctrine Query Language) - Introduction.php +++ b/manual/docs/DQL (Doctrine Query Language) - Introduction.php @@ -9,39 +9,15 @@ When compared to using raw SQL, DQL has several benefits:
  • DQL understands relations so you don't have to type manually sql joins and join conditions + If the power of DQL isn't enough, you should consider using the rawSql API for object population. -Standard DQL query consists of the following parts: - - - - - -
    -In BNF syntax, a select statement is defined as: - select_statement :: = select_clause from_clause [where_clause] [groupby_clause] - [having_clause] [orderby_clause] -
    -A select statement must always have a SELECT and a FROM clause. The square brackets [] indicate -that the other clauses are optional. diff --git a/manual/docs/DQL (Doctrine Query Language) - UPDATE queries.php b/manual/docs/DQL (Doctrine Query Language) - UPDATE queries.php new file mode 100644 index 000000000..ab308d48c --- /dev/null +++ b/manual/docs/DQL (Doctrine Query Language) - UPDATE queries.php @@ -0,0 +1,24 @@ +UPDATE statement syntax: +
    +
    +UPDATE component_name
    +    SET col_name1=expr1 [, col_name2=expr2 ...]
    +    [WHERE where_condition]
    +    [ORDER BY ...]
    +    [LIMIT record_count]
    +
    +
    + diff --git a/manual/documentation.php b/manual/documentation.php index e80341b78..e7164f9e8 100644 --- a/manual/documentation.php +++ b/manual/documentation.php @@ -304,9 +304,14 @@ $menu = array("Getting started" => "OffsetIterator") */ ), + "DQL (Doctrine Query Language)" => - array('Introduction', + array( + 'Introduction', + 'SELECT queries', + 'UPDATE queries', + 'DELETE queries', 'FROM clause', 'WHERE clause', 'Conditional expressions' => @@ -323,7 +328,7 @@ $menu = array("Getting started" => 'Empty Collection Comparison Expressions', 'Collection Member Expressions', 'Exists Expressions', - 'All or Any Expressions', + 'All and Any Expressions', 'Subqueries'), 'Functional Expressions' => array('String functions', @@ -336,16 +341,6 @@ $menu = array("Getting started" => 'LIMIT and OFFSET clauses', 'Examples', 'BNF'), - /** - 'Functions' => array( - 'Contains', - 'Regexp', - 'Like'), - 'Operators' => array( - 'Logical operators') - - - */ "Transactions" => array( "Introduction",