diff --git a/manual/codes/Basic Components - Query - FROM - selecting tables.php b/manual/codes/Basic Components - Query - FROM - selecting tables.php index 677533c40..e96445523 100644 --- a/manual/codes/Basic Components - Query - FROM - selecting tables.php +++ b/manual/codes/Basic Components - Query - FROM - selecting tables.php @@ -5,7 +5,7 @@ $coll = $q->from("FROM Group"); // find all users and user emails -$coll = $q->from("FROM User.Email"); +$coll = $q->from("FROM User u LEFT JOIN u.Email e"); // find all users and user emails with only user name and // age + email address loaded diff --git a/manual/codes/Basic Components - Query - Introduction.php b/manual/codes/Basic Components - Query - Introduction.php index e69de29bb..33c72b34c 100644 --- a/manual/codes/Basic Components - Query - Introduction.php +++ b/manual/codes/Basic Components - Query - Introduction.php @@ -0,0 +1,8 @@ + diff --git a/manual/codes/Basic Components - Query - LIMIT and OFFSET - limiting the query results.php b/manual/codes/Basic Components - Query - LIMIT and OFFSET - limiting the query results.php index 0df929b59..5b94b58ec 100644 --- a/manual/codes/Basic Components - Query - LIMIT and OFFSET - limiting the query results.php +++ b/manual/codes/Basic Components - Query - LIMIT and OFFSET - limiting the query results.php @@ -1,11 +1,13 @@ query("FROM User, User.Email LIMIT 10"); +$q = new Doctrine_Query(); + +$coll = $q->from('User u LEFT JOIN u.Email e')->limit(10); // find the first ten users starting from the user number 5 -$coll = $conn->query("FROM User LIMIT 10 OFFSET 5"); +$coll = $q->from('User u')->limit(10)->offset(5); ?> diff --git a/manual/codes/Basic Components - Query - Relation operators.php b/manual/codes/Basic Components - Query - Relation operators.php index 977624130..a917daea4 100644 --- a/manual/codes/Basic Components - Query - Relation operators.php +++ b/manual/codes/Basic Components - Query - Relation operators.php @@ -1,12 +1,12 @@ from("User:Email"); +$query->from('User u')->innerJoin('u.Email e'); $query->execute(); // executed SQL query: // SELECT ... FROM user INNER JOIN email ON ... -$query->from("User.Email"); +$query->from('User u')->leftJoin('u.Email e'); $query->execute(); diff --git a/manual/codes/Basic Components - Query - WHERE - setting query conditions.php b/manual/codes/Basic Components - Query - WHERE - setting query conditions.php index 933cd01f0..d3f5a12fa 100644 --- a/manual/codes/Basic Components - Query - WHERE - setting query conditions.php +++ b/manual/codes/Basic Components - Query - WHERE - setting query conditions.php @@ -1,27 +1 @@ -query("FROM Group WHERE Group.id > 10"); - -// find all users where users where user name matches a regular expression, -// REGEXP keyword must be supported by the underlying database - -$coll = $conn->query("FROM User WHERE User.name REGEXP '[ad]'"); - -// find all users and their associated emails where SOME of the users phonenumbers -// (the association between user and phonenumber tables is Many-To-Many) starts with 123 - -$coll = $conn->query("FROM User, User.Email WHERE User.Phonenumber.phonenumber LIKE '123%'"); - -// multiple conditions - -$coll = $conn->query("FROM User WHERE User.name LIKE '%Jack%' && User.Email.address LIKE '%@drinkmore.info'"); - -// nesting conditions - -$coll = $conn->query("FROM User WHERE (User.name LIKE '%Jack%' || User.name LIKE '%John%') && User.Email.address LIKE '%@drinkmore.info'"); - -?> diff --git a/manual/codes/Schema reference - Data types - Array.php b/manual/codes/Schema reference - Data types - Array.php new file mode 100644 index 000000000..f6446c774 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Array.php @@ -0,0 +1,7 @@ +hasColumn('arraytest', 'array', 10000); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Blob.php b/manual/codes/Schema reference - Data types - Blob.php new file mode 100644 index 000000000..c20257a73 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Blob.php @@ -0,0 +1,7 @@ +hasColumn('blobtest', 'blob'); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Boolean.php b/manual/codes/Schema reference - Data types - Boolean.php new file mode 100644 index 000000000..1f0ab9cd2 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Boolean.php @@ -0,0 +1,7 @@ +hasColumn('booltest', 'boolean'); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Clob.php b/manual/codes/Schema reference - Data types - Clob.php new file mode 100644 index 000000000..d25420d08 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Clob.php @@ -0,0 +1,7 @@ +hasColumn('clobtest', 'clob'); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Date.php b/manual/codes/Schema reference - Data types - Date.php new file mode 100644 index 000000000..50bcca1e4 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Date.php @@ -0,0 +1,7 @@ +hasColumn('datetest', 'date'); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Enum.php b/manual/codes/Schema reference - Data types - Enum.php new file mode 100644 index 000000000..410aefc19 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Enum.php @@ -0,0 +1,14 @@ +hasColumn('enumtest', 'enum', 4, + array( + 'values' => array( + 'php', + 'java', + 'python' + ) + ); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Float.php b/manual/codes/Schema reference - Data types - Float.php new file mode 100644 index 000000000..bd12c57a1 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Float.php @@ -0,0 +1,7 @@ +hasColumn('floattest', 'float'); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Gzip.php b/manual/codes/Schema reference - Data types - Gzip.php new file mode 100644 index 000000000..aaf1a0a17 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Gzip.php @@ -0,0 +1,7 @@ +hasColumn('gziptest', 'gzip'); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Integer.php b/manual/codes/Schema reference - Data types - Integer.php new file mode 100644 index 000000000..2f7fcdac0 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Integer.php @@ -0,0 +1,7 @@ +hasColumn('integertest', 'integer', 4, array('unsigned' => true); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Object.php b/manual/codes/Schema reference - Data types - Object.php new file mode 100644 index 000000000..641815133 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Object.php @@ -0,0 +1,7 @@ +hasColumn('objecttest', 'object'); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - String.php b/manual/codes/Schema reference - Data types - String.php new file mode 100644 index 000000000..5e53f6a06 --- /dev/null +++ b/manual/codes/Schema reference - Data types - String.php @@ -0,0 +1,7 @@ +hasColumn('stringtest', 'string', 200, array('fixed' => true)); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Time.php b/manual/codes/Schema reference - Data types - Time.php new file mode 100644 index 000000000..fc69af27a --- /dev/null +++ b/manual/codes/Schema reference - Data types - Time.php @@ -0,0 +1,7 @@ +hasColumn('timetest', 'time'); + } +} +?> diff --git a/manual/codes/Schema reference - Data types - Timestamp.php b/manual/codes/Schema reference - Data types - Timestamp.php new file mode 100644 index 000000000..bd069ab91 --- /dev/null +++ b/manual/codes/Schema reference - Data types - Timestamp.php @@ -0,0 +1,7 @@ +hasColumn('timestamptest', 'timestamp'); + } +} +?>