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
305d3b35
Commit
305d3b35
authored
Aug 31, 2008
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some more test models
parent
b5401ee1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
CompanyEmployee.php
tests/models/company/CompanyEmployee.php
+41
-0
CompanyManager.php
tests/models/company/CompanyManager.php
+14
-0
No files found.
tests/models/company/CompanyEmployee.php
0 → 100644
View file @
305d3b35
<?php
class
CompanyEmployee
extends
Doctrine_Entity
{
#protected $id;
#protected $salary;
#protected $department;
public
static
function
initMetadata
(
$mapping
)
{
// inheritance mapping
$mapping
->
setInheritanceType
(
'joined'
,
array
(
'discriminatorColumn'
=>
'dtype'
,
'discriminatorMap'
=>
array
(
'emp'
=>
'CompanyEmployee'
,
'man'
=>
'CompanyManager'
)
));
// register subclasses
$mapping
->
setSubclasses
(
array
(
'CompanyManager'
));
$mapping
->
mapField
(
array
(
'fieldName'
=>
'id'
,
'type'
=>
'integer'
,
'length'
=>
4
,
'id'
=>
true
,
'idGenerator'
=>
'auto'
));
$mapping
->
mapField
(
array
(
'fieldName'
=>
'salary'
,
'type'
=>
'double'
));
//TODO: make department an entity
$mapping
->
mapField
(
array
(
'fieldName'
=>
'department'
,
'type'
=>
'string'
));
}
}
?>
\ No newline at end of file
tests/models/company/CompanyManager.php
0 → 100644
View file @
305d3b35
<?php
class
CompanyManager
extends
CompanyEmployee
{
public
static
function
initMetadata
(
$mapping
)
{
$mapping
->
mapColumn
(
array
(
'fieldName'
=>
'title'
,
'type'
=>
'string'
));
}
}
?>
\ No newline at end of file
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