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
12a21ba5
Commit
12a21ba5
authored
Sep 04, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doctrine_Query::create() added for lazy folks
parent
276af652
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
8 deletions
+36
-8
Query.php
Doctrine/Query.php
+9
-0
Getting started - Setting table definition - Constraints and validators.php
...Setting table definition - Constraints and validators.php
+7
-7
Getting started - Setting table definition - Introduction.php
...ing started - Setting table definition - Introduction.php
+20
-1
No files found.
Doctrine/Query.php
View file @
12a21ba5
...
@@ -39,6 +39,15 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
...
@@ -39,6 +39,15 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
* @param boolean $limitSubqueryUsed
* @param boolean $limitSubqueryUsed
*/
*/
private
$limitSubqueryUsed
=
false
;
private
$limitSubqueryUsed
=
false
;
/**
* create
* returns a new Doctrine_Query object
*
* @return Doctrine_Query
*/
public
static
function
create
()
{
return
new
Doctrine_Query
();
}
/**
/**
* count
* count
*
*
...
...
manual/codes/Getting started - Setting table definition - Constraints and validators.php
View file @
12a21ba5
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
class
User
extends
Doctrine_Record
{
class
User
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
public
function
setTableDefinition
()
{
// the name cannot contain whitespace
// the name cannot contain whitespace
$this
->
hasColumn
(
"name"
,
"string"
,
50
,
"nospace"
);
$this
->
hasColumn
(
"name"
,
"string"
,
50
,
array
(
"nospace"
=>
true
)
);
// the email should be a valid email
// the email should be a valid email
$this
->
hasColumn
(
"email"
,
"string"
,
200
,
"email"
);
$this
->
hasColumn
(
"email"
,
"string"
,
200
,
array
(
"email"
=>
true
)
);
// home_country should be a valid country code
// home_country should be a valid country code
and not null
$this
->
hasColumn
(
"home_country"
,
"string"
,
2
,
"country"
);
$this
->
hasColumn
(
"home_country"
,
"string"
,
2
,
array
(
"country"
=>
true
,
"notnull"
=>
true
)
);
}
}
}
}
?>
?>
manual/codes/Getting started - Setting table definition - Introduction.php
View file @
12a21ba5
...
@@ -7,7 +7,26 @@ class Email extends Doctrine_Record {
...
@@ -7,7 +7,26 @@ class Email extends Doctrine_Record {
$this
->
hasColumn
(
"address"
,
// name of the column
$this
->
hasColumn
(
"address"
,
// name of the column
"string"
,
// column type
"string"
,
// column type
"200"
,
// column length
"200"
,
// column length
"notblank|email"
// validators / constraints
array
(
"notblank"
=>
true
,
"email"
=>
true
// validators / constraints
);
$this
->
hasColumn
(
"address2"
,
// name of the column
"string"
,
// column type
"200"
,
// column length
// validators / constraints without arguments can be
// specified also as as string with | separator
"notblank|email"
,
);
// Doctrine even supports the following format for
// validators / constraints which have no arguments:
$this
->
hasColumn
(
"address3"
,
// name of the column
"string"
,
// column type
"200"
,
// column length
array
(
"notblank"
,
"email"
),
);
);
}
}
}
}
...
...
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