Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
4b9b61aa
Commit
4b9b61aa
authored
Dec 03, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added data type code examples
parent
9257eefe
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
114 additions
and
32 deletions
+114
-32
Basic Components - Query - FROM - selecting tables.php
...es/Basic Components - Query - FROM - selecting tables.php
+1
-1
Basic Components - Query - Introduction.php
manual/codes/Basic Components - Query - Introduction.php
+8
-0
Basic Components - Query - LIMIT and OFFSET - limiting the query results.php
...Query - LIMIT and OFFSET - limiting the query results.php
+5
-3
Basic Components - Query - Relation operators.php
...l/codes/Basic Components - Query - Relation operators.php
+2
-2
Basic Components - Query - WHERE - setting query conditions.php
...Components - Query - WHERE - setting query conditions.php
+0
-26
Schema reference - Data types - Array.php
manual/codes/Schema reference - Data types - Array.php
+7
-0
Schema reference - Data types - Blob.php
manual/codes/Schema reference - Data types - Blob.php
+7
-0
Schema reference - Data types - Boolean.php
manual/codes/Schema reference - Data types - Boolean.php
+7
-0
Schema reference - Data types - Clob.php
manual/codes/Schema reference - Data types - Clob.php
+7
-0
Schema reference - Data types - Date.php
manual/codes/Schema reference - Data types - Date.php
+7
-0
Schema reference - Data types - Enum.php
manual/codes/Schema reference - Data types - Enum.php
+14
-0
Schema reference - Data types - Float.php
manual/codes/Schema reference - Data types - Float.php
+7
-0
Schema reference - Data types - Gzip.php
manual/codes/Schema reference - Data types - Gzip.php
+7
-0
Schema reference - Data types - Integer.php
manual/codes/Schema reference - Data types - Integer.php
+7
-0
Schema reference - Data types - Object.php
manual/codes/Schema reference - Data types - Object.php
+7
-0
Schema reference - Data types - String.php
manual/codes/Schema reference - Data types - String.php
+7
-0
Schema reference - Data types - Time.php
manual/codes/Schema reference - Data types - Time.php
+7
-0
Schema reference - Data types - Timestamp.php
manual/codes/Schema reference - Data types - Timestamp.php
+7
-0
No files found.
manual/codes/Basic Components - Query - FROM - selecting tables.php
View file @
4b9b61aa
...
@@ -5,7 +5,7 @@ $coll = $q->from("FROM Group");
...
@@ -5,7 +5,7 @@ $coll = $q->from("FROM Group");
// find all users and user emails
// 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
// find all users and user emails with only user name and
// age + email address loaded
// age + email address loaded
...
...
manual/codes/Basic Components - Query - Introduction.php
View file @
4b9b61aa
<?php
// initalizing a new Doctrine_Query (using the current connection)
$q
=
new
Doctrine_Query
();
// initalizing a new Doctrine_Query (using custom connection parameter)
// here $conn is an instance of Doctrine_Connection
$q
=
new
Doctrine_Query
(
$conn
);
?>
manual/codes/Basic Components - Query - LIMIT and OFFSET - limiting the query results.php
View file @
4b9b61aa
<?php
<?php
// find the first ten users and
their
emails
// find the first ten users and
associated
emails
$coll
=
$conn
->
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
// 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
);
?>
?>
manual/codes/Basic Components - Query - Relation operators.php
View file @
4b9b61aa
<?php
<?php
$query
->
from
(
"User:Email"
);
$query
->
from
(
'User u'
)
->
innerJoin
(
'u.Email e'
);
$query
->
execute
();
$query
->
execute
();
// executed SQL query:
// executed SQL query:
// SELECT ... FROM user INNER JOIN email ON ...
// SELECT ... FROM user INNER JOIN email ON ...
$query
->
from
(
"User.Email"
);
$query
->
from
(
'User u'
)
->
leftJoin
(
'u.Email e'
);
$query
->
execute
();
$query
->
execute
();
...
...
manual/codes/Basic Components - Query - WHERE - setting query conditions.php
View file @
4b9b61aa
<?php
// find all groups where the group primary key is bigger than 10
$coll
=
$conn
->
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'"
);
?>
manual/codes/Schema reference - Data types - Array.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'arraytest'
,
'array'
,
10000
);
}
}
?>
manual/codes/Schema reference - Data types - Blob.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'blobtest'
,
'blob'
);
}
}
?>
manual/codes/Schema reference - Data types - Boolean.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'booltest'
,
'boolean'
);
}
}
?>
manual/codes/Schema reference - Data types - Clob.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'clobtest'
,
'clob'
);
}
}
?>
manual/codes/Schema reference - Data types - Date.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'datetest'
,
'date'
);
}
}
?>
manual/codes/Schema reference - Data types - Enum.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'enumtest'
,
'enum'
,
4
,
array
(
'values'
=>
array
(
'php'
,
'java'
,
'python'
)
);
}
}
?>
manual/codes/Schema reference - Data types - Float.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'floattest'
,
'float'
);
}
}
?>
manual/codes/Schema reference - Data types - Gzip.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'gziptest'
,
'gzip'
);
}
}
?>
manual/codes/Schema reference - Data types - Integer.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'integertest'
,
'integer'
,
4
,
array
(
'unsigned'
=>
true
);
}
}
?>
manual/codes/Schema reference - Data types - Object.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'objecttest'
,
'object'
);
}
}
?>
manual/codes/Schema reference - Data types - String.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'stringtest'
,
'string'
,
200
,
array
(
'fixed'
=>
true
));
}
}
?>
manual/codes/Schema reference - Data types - Time.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'timetest'
,
'time'
);
}
}
?>
manual/codes/Schema reference - Data types - Timestamp.php
0 → 100644
View file @
4b9b61aa
<?php
class
Test
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'timestamptest'
,
'timestamp'
);
}
}
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment