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
3b8b1a4e
Commit
3b8b1a4e
authored
Aug 30, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added connection & collection introductions + first code examples for Doctrine_View
parent
77a69bc5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
1 deletion
+39
-1
Advanced components - View - Managing views.php
manual/codes/Advanced components - View - Managing views.php
+15
-0
Advanced components - View - Using views.php
manual/codes/Advanced components - View - Using views.php
+13
-0
Basic Components - Collection - Introduction.php
...al/codes/Basic Components - Collection - Introduction.php
+10
-1
Basic Components - Connection - Introduction.php
...al/codes/Basic Components - Connection - Introduction.php
+1
-0
No files found.
manual/codes/Advanced components - View - Managing views.php
View file @
3b8b1a4e
<?php
$conn
=
Doctrine_Manager
::
getInstance
()
->
openConnection
(
new
PDO
(
"dsn"
,
"username"
,
"password"
);
$query
=
new
Doctrine_Query
(
$conn
);
$query
->
from
(
'User.Phonenumber'
)
->
limit
(
20
);
$view
=
new
Doctrine_View
(
$query
,
'MyView'
);
// creating a database view
$view
->
create
();
// dropping the view from the database
$view
->
drop
();
?>
manual/codes/Advanced components - View - Using views.php
View file @
3b8b1a4e
<?php
$conn
=
Doctrine_Manager
::
getInstance
()
->
openConnection
(
new
PDO
(
"dsn"
,
"username"
,
"password"
));
$query
=
new
Doctrine_Query
(
$conn
);
$query
->
from
(
'User.Phonenumber'
)
->
limit
(
20
);
// hook the query into appropriate view
$view
=
new
Doctrine_View
(
$query
,
'MyView'
);
// now fetch the data from the view
$coll
=
$view
->
execute
();
?>
manual/codes/Basic Components - Collection - Introduction.php
View file @
3b8b1a4e
<?php
$coll
=
new
Doctrine_Collection
(
'User'
);
$conn
=
Doctrine_Manager
::
getInstance
()
->
openConnection
(
new
PDO
(
"dsn"
,
"username"
,
"pw"
));
// initalizing a new collection
$users
=
new
Doctrine_Collection
(
$conn
->
getTable
(
'User'
));
// alternative (propably easier)
$users
=
new
Doctrine_Collection
(
'User'
);
// adding some data
$coll
[
0
]
->
name
=
'Arnold'
;
$coll
[
1
]
->
name
=
'Somebody'
;
// finally save it!
$coll
->
save
();
?>
manual/codes/Basic Components - Connection - Introduction.php
View file @
3b8b1a4e
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