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
578556eb
Commit
578556eb
authored
Sep 24, 2007
by
Jonathan.Wage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made a change so we have a table object like in normal doctrine.
parent
eca4f7a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
18 deletions
+4
-18
Client.php
lib/Doctrine/Resource/Client.php
+2
-17
index.php
playground/index.php
+2
-1
No files found.
lib/Doctrine/Resource/Client.php
View file @
578556eb
...
...
@@ -88,24 +88,9 @@ class Doctrine_Resource_Client extends Doctrine_Resource
}
}
public
function
find
(
$model
,
$pk
)
public
function
getTable
(
$table
)
{
$record
=
$this
->
newRecord
(
$model
);
$pk
=
is_array
(
$pk
)
?
$pk
:
array
(
$pk
);
$identifier
=
$record
->
identifier
();
$identifier
=
is_array
(
$identifier
)
?
$identifier
:
array
(
$identifier
);
$where
=
''
;
foreach
(
array_keys
(
$identifier
)
as
$key
=>
$name
)
{
$value
=
$pk
[
$key
];
$where
.=
$model
.
'.'
.
$name
.
' = '
.
$value
;
}
$query
=
new
Doctrine_Resource_Query
();
$query
->
from
(
$model
)
->
where
(
$where
)
->
limit
(
1
);
return
$query
->
execute
()
->
getFirst
();
return
new
Doctrine_Resource_Table
(
$table
);
}
public
function
newQuery
()
...
...
playground/index.php
View file @
578556eb
...
...
@@ -18,8 +18,9 @@ if ($action == 'server') {
$config
=
array
(
'url'
=>
'http://localhost/~jwage/doctrine_trunk/playground/index.php?action=server'
);
$client
=
Doctrine_Resource_Client
::
getInstance
(
$config
);
$table
=
$client
->
getTable
(
'User'
);
$user
=
$
client
->
find
(
'User'
,
4
);
$user
=
$
table
->
find
(
4
);
$user
->
Phonenumber
->
add
()
->
phonenumber
=
'555-5555'
;
$user
->
name
=
'jonnwage'
;
$user
->
save
();
...
...
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