From 75242e50228d8b694b639939d53ab76b6e5417a1 Mon Sep 17 00:00:00 2001 From: zYne Date: Sat, 16 Sep 2006 17:52:58 +0000 Subject: [PATCH] DQL docs updated --- ...Query Language) - Functions - Contains.php | 7 ++ ...ine Query Language) - Functions - Like.php | 7 ++ ...e Query Language) - Functions - Regexp.php | 7 ++ ...guage) - Operators - Logical operators.php | 0 ...Query Language) - Functions - Contains.php | 0 ...ine Query Language) - Functions - Like.php | 0 ...e Query Language) - Functions - Regexp.php | 0 ...guage) - Operators - Logical operators.php | 110 ++++++++++++++++++ manual/documentation.php | 19 ++- 9 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 manual/codes/DQL (Doctrine Query Language) - Functions - Contains.php create mode 100644 manual/codes/DQL (Doctrine Query Language) - Functions - Like.php create mode 100644 manual/codes/DQL (Doctrine Query Language) - Functions - Regexp.php create mode 100644 manual/codes/DQL (Doctrine Query Language) - Operators - Logical operators.php create mode 100644 manual/docs/DQL (Doctrine Query Language) - Functions - Contains.php create mode 100644 manual/docs/DQL (Doctrine Query Language) - Functions - Like.php create mode 100644 manual/docs/DQL (Doctrine Query Language) - Functions - Regexp.php create mode 100644 manual/docs/DQL (Doctrine Query Language) - Operators - Logical operators.php diff --git a/manual/codes/DQL (Doctrine Query Language) - Functions - Contains.php b/manual/codes/DQL (Doctrine Query Language) - Functions - Contains.php new file mode 100644 index 000000000..126a7c0c4 --- /dev/null +++ b/manual/codes/DQL (Doctrine Query Language) - Functions - Contains.php @@ -0,0 +1,7 @@ +from('User')->where('User.Phonenumber.phonenumber.contains(?,?,?)'); + +$users = $q->execute(array('123 123 123', '0400 999 999', '+358 100 100')); +?> diff --git a/manual/codes/DQL (Doctrine Query Language) - Functions - Like.php b/manual/codes/DQL (Doctrine Query Language) - Functions - Like.php new file mode 100644 index 000000000..873fd47bc --- /dev/null +++ b/manual/codes/DQL (Doctrine Query Language) - Functions - Like.php @@ -0,0 +1,7 @@ +from('User')->where('User.Phonenumber.phonenumber.like(?,?)'); + +$users = $q->execute(array('%123%', '456%')); +?> diff --git a/manual/codes/DQL (Doctrine Query Language) - Functions - Regexp.php b/manual/codes/DQL (Doctrine Query Language) - Functions - Regexp.php new file mode 100644 index 000000000..6739d6a5f --- /dev/null +++ b/manual/codes/DQL (Doctrine Query Language) - Functions - Regexp.php @@ -0,0 +1,7 @@ +from('User')->where('User.Phonenumber.phonenumber.regexp(?,?)'); + +$users = $q->execute(array('[123]', '^[3-5]')); +?> diff --git a/manual/codes/DQL (Doctrine Query Language) - Operators - Logical operators.php b/manual/codes/DQL (Doctrine Query Language) - Operators - Logical operators.php new file mode 100644 index 000000000..e69de29bb diff --git a/manual/docs/DQL (Doctrine Query Language) - Functions - Contains.php b/manual/docs/DQL (Doctrine Query Language) - Functions - Contains.php new file mode 100644 index 000000000..e69de29bb diff --git a/manual/docs/DQL (Doctrine Query Language) - Functions - Like.php b/manual/docs/DQL (Doctrine Query Language) - Functions - Like.php new file mode 100644 index 000000000..e69de29bb diff --git a/manual/docs/DQL (Doctrine Query Language) - Functions - Regexp.php b/manual/docs/DQL (Doctrine Query Language) - Functions - Regexp.php new file mode 100644 index 000000000..e69de29bb diff --git a/manual/docs/DQL (Doctrine Query Language) - Operators - Logical operators.php b/manual/docs/DQL (Doctrine Query Language) - Operators - Logical operators.php new file mode 100644 index 000000000..3b63ada08 --- /dev/null +++ b/manual/docs/DQL (Doctrine Query Language) - Operators - Logical operators.php @@ -0,0 +1,110 @@ + +
  • +

    NOT, ! +

    +

    + Logical NOT. Evaluates to 1 if the + operand is 0, to 0 if + the operand is non-zero, and NOT NULL + returns NULL. +

    +DQL condition : NOT 10
    + -> 0
    +DQL condition : NOT 0
    + -> 1
    +DQL condition : NOT NULL
    + -> NULL
    +DQL condition : ! (1+1)
    + -> 0
    +DQL condition : ! 1+1
    + -> 1
    + +

    + The last example produces 1 because the + expression evaluates the same way as + (!1)+1. +

    +
  • +
  • +

    + + + + + AND +

    +

    + Logical AND. Evaluates to 1 if all + operands are non-zero and not NULL, to + 0 if one or more operands are + 0, otherwise NULL is + returned. +

    +DQL condition : 1 AND 1
    + -> 1
    +DQL condition : 1 AND 0
    + -> 0
    +DQL condition : 1 AND NULL
    + -> NULL
    +DQL condition : 0 AND NULL
    + -> 0
    +DQL condition : NULL AND 0
    + -> 0
    + +
  • +
  • + + + OR +

    +

    + Logical OR. When both operands are + non-NULL, the result is + 1 if any operand is non-zero, and + 0 otherwise. With a + NULL operand, the result is + 1 if the other operand is non-zero, and + NULL otherwise. If both operands are + NULL, the result is + NULL. +

    +DQL condition : 1 OR 1
    + -> 1
    +DQL condition : 1 OR 0
    + -> 1
    +DQL condition : 0 OR 0
    + -> 0
    +DQL condition : 0 OR NULL
    + -> NULL
    +DQL condition : 1 OR NULL
    + -> 1
    + +
  • +
  • +

    + + + XOR +

    +

    + Logical XOR. Returns NULL if either + operand is NULL. For + non-NULL operands, evaluates to + 1 if an odd number of operands is + non-zero, otherwise 0 is returned. +

    +DQL condition : 1 XOR 1
    + -> 0
    +DQL condition : 1 XOR 0
    + -> 1
    +DQL condition : 1 XOR NULL
    + -> NULL
    +DQL condition : 1 XOR 1 XOR 1
    + -> 1
    + +

    + a XOR b is mathematically equal to + (a AND (NOT b)) OR ((NOT a) and b). +

    +
  • + diff --git a/manual/documentation.php b/manual/documentation.php index c5ea62856..decf53d76 100644 --- a/manual/documentation.php +++ b/manual/documentation.php @@ -279,7 +279,24 @@ $menu = array("Getting started" => */ ), "DQL (Doctrine Query Language)" => - array( + array('Syntax' => + array( + 'FROM', + 'WHERE', + 'GROUP BY', + 'HAVING', + 'ORDER BY', + 'LIMIT and OFFSET', + ), + + 'Functions' => array( + 'Contains', + 'Regexp', + 'Like'), + 'Operators' => array( + 'Logical operators') + + ), "Transactions" => array(