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
5cb3086d
Commit
5cb3086d
authored
Sep 26, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Schema classes updated
parent
79cbc455
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
100 deletions
+45
-100
Column.php
Doctrine/Schema/Column.php
+8
-10
Object.php
Doctrine/Schema/Object.php
+14
-48
Table.php
Doctrine/Schema/Table.php
+23
-42
No files found.
Doctrine/Schema/Column.php
View file @
5cb3086d
...
@@ -38,14 +38,13 @@ class Doctrine_Schema_Column extends Doctrine_Schema_Object implements IteratorA
...
@@ -38,14 +38,13 @@ class Doctrine_Schema_Column extends Doctrine_Schema_Object implements IteratorA
* column definitions
* column definitions
* @var array $definition
* @var array $definition
*/
*/
private
$definition
=
array
(
'name'
=>
''
,
protected
$definition
=
array
(
'name'
=>
''
,
'type'
=>
''
,
'type'
=>
''
,
'unique'
=>
false
,
'unique'
=>
false
,
'primary'
=>
false
,
'primary'
=>
false
,
'notnull'
=>
false
,
'notnull'
=>
false
,
'default'
=>
null
,
'default'
=>
null
,
);
);
public
function
__construct
(
array
$definition
)
{
public
function
__construct
(
array
$definition
)
{
foreach
(
$this
->
definition
as
$key
=>
$val
)
{
foreach
(
$this
->
definition
as
$key
=>
$val
)
{
...
@@ -71,5 +70,4 @@ class Doctrine_Schema_Column extends Doctrine_Schema_Object implements IteratorA
...
@@ -71,5 +70,4 @@ class Doctrine_Schema_Column extends Doctrine_Schema_Object implements IteratorA
public
function
isNotNull
()
{
public
function
isNotNull
()
{
return
$this
->
definition
[
'notnull'
];
return
$this
->
definition
[
'notnull'
];
}
}
}
// end of Doctrine_Schema_Column
}
Doctrine/Schema/Object.php
View file @
5cb3086d
...
@@ -33,69 +33,35 @@
...
@@ -33,69 +33,35 @@
* class Doctrine_Schema_Object
* class Doctrine_Schema_Object
* Catches any non-property call from child classes and throws an exception.
* Catches any non-property call from child classes and throws an exception.
*/
*/
abstract
class
Doctrine_Schema_Object
abstract
class
Doctrine_Schema_Object
implements
IteratorAggregate
,
Countable
{
implements
IteratorAggregate
,
Countable
{
/** Aggregations: */
/** Compositions: */
/*** Attributes: ***/
/**
*
* @param string _property
* @param mixed _value
* @return
* @access public
*/
public
function
__set
(
$_property
,
$_value
)
{
throw
new
Doctrine_Schema_Exception
(
'Assignment of non-property'
);
}
// end of member function __set
/**
*
* @param string _property
* @return
* @access public
*/
public
function
__get
(
$_property
)
{
throw
new
Doctrine_Schema_Exception
(
'Access of non-property'
);
}
// end of member function __get
protected
$children
=
array
();
protected
$definition
=
array
();
/**
/**
*
*
* @return int
* @return int
* @access public
* @access public
*/
*/
public
function
count
(
)
public
function
count
()
{
{
if
(
!
empty
(
$this
->
childs
))
if
(
!
empty
(
$this
->
childs
))
{
return
count
(
$this
->
childs
);
return
count
(
$this
->
childs
);
}
return
0
;
return
count
(
$this
->
definition
)
;
}
}
/**
/**
* getIterator
*
*
* @return
* @return
ArrayIterator
* @access public
* @access public
*/
*/
public
function
getIterator
(
)
public
function
getIterator
()
{
{
if
(
!
empty
(
$this
->
childs
))
if
(
!
empty
(
$this
->
childs
))
{
return
new
ArrayIterator
(
$this
->
childs
);
return
new
ArrayIterator
(
$this
->
childs
);
}
return
new
ArrayIterator
();
}
}
// end of Doctrine_Schema_Object
return
new
ArrayIterator
(
$this
->
definition
);
}
}
Doctrine/Schema/Table.php
View file @
5cb3086d
...
@@ -37,14 +37,6 @@ class Doctrine_Schema_Table extends Doctrine_Schema_Object
...
@@ -37,14 +37,6 @@ class Doctrine_Schema_Table extends Doctrine_Schema_Object
implements
Countable
,
Countable
,
IteratorAggregate
implements
Countable
,
Countable
,
IteratorAggregate
{
{
/** Aggregations: */
/** Compositions: */
var
$m_Vector
=
array
();
var
$m_
;
/*** Attributes: ***/
/**
/**
* Unique key fields
* Unique key fields
* @access public
* @access public
...
@@ -85,53 +77,42 @@ class Doctrine_Schema_Table extends Doctrine_Schema_Object
...
@@ -85,53 +77,42 @@ class Doctrine_Schema_Table extends Doctrine_Schema_Object
* @access public
* @access public
*/
*/
public
$description
;
public
$description
;
/**
* Columns of the table
* @access private
*/
private
$childs
;
/**
/**
*
*
* @return
* @return
bool
* @access public
* @access public
*/
*/
public
function
__toString
(
)
{
public
function
isValid
(
)
{
}
// end of member function __toString
}
/**
/**
* returns an array of Doctrine_Schema_Column objects
*
*
* @return
* @return array
* @access public
*/
*/
public
function
__clone
(
)
{
public
function
getColumns
()
{
return
$this
->
children
;
}
// end of member function __clone
}
/**
/**
*
* @return Doctrine_Schema_Column|false
* @return bool
* @access public
*/
*/
public
function
isValid
(
)
{
public
function
getColumn
(
$name
)
{
if
(
!
isset
(
$this
->
children
[
$name
]))
}
// end of member function isValid
return
false
;
return
$this
->
children
[
$name
];
}
/**
/**
*
*
* @param Doctrine_Schema_Column column * @return Doctrine_Schema_Column
* @param Doctrine_Schema_Column column
* @return Doctrine_Schema_Table
* @access public
* @access public
*/
*/
public
function
addColumn
(
$column
=
null
)
{
public
function
addColumn
(
Doctrine_Schema_Column
$column
)
{
$name
=
$column
->
getName
();
}
// end of member function addColumn
$this
->
children
[
$name
]
=
$column
;
}
// end of Doctrine_Schema_Table
return
$this
;
}
}
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