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
35aa9a48
Commit
35aa9a48
authored
Jul 15, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Adding missing event classes and some AnnotationDriver refactorings.
parent
7a79785d
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
176 additions
and
69 deletions
+176
-69
Events.php
lib/Doctrine/DBAL/Events.php
+42
-0
Configuration.php
lib/Doctrine/ORM/Configuration.php
+22
-17
EntityManager.php
lib/Doctrine/ORM/EntityManager.php
+3
-1
EntityManagerException.php
lib/Doctrine/ORM/EntityManagerException.php
+1
-26
PreInsertEventArgs.php
lib/Doctrine/ORM/Event/PreInsertEventArgs.php
+39
-0
PreUpdateEventArgs.php
lib/Doctrine/ORM/Event/PreUpdateEventArgs.php
+34
-0
AnnotationDriver.php
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
+35
-25
No files found.
lib/Doctrine/DBAL/Events.php
0 → 100644
View file @
35aa9a48
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\DBAL
;
/**
* Container for all DBAL events.
*
* This class cannot be instantiated.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
final
class
Events
{
private
function
__construct
()
{}
const
preExec
=
'preExec'
;
const
postExec
=
'postExec'
;
const
preExecute
=
'preExecute'
;
const
postExecute
=
'postExecute'
;
}
lib/Doctrine/ORM/Configuration.php
View file @
35aa9a48
...
...
@@ -21,8 +21,6 @@
namespace
Doctrine\ORM
;
use
Doctrine\ORM\Mapping\Driver\AnnotationDriver
;
/**
* Configuration container for all configuration options of Doctrine.
* It combines all configuration options from DBAL & ORM.
...
...
@@ -44,16 +42,21 @@ class Configuration extends \Doctrine\DBAL\Configuration
'resultCacheImpl'
=>
null
,
'queryCacheImpl'
=>
null
,
'metadataCacheImpl'
=>
null
,
'metadataDriverImpl'
=>
new
AnnotationDriver
(),
'dqlClassAliasMap'
=>
array
(),
'metadataDriverImpl'
=>
null
,
'cacheDir'
=>
null
,
'allowPartialObjects'
=>
true
,
'useCExtension'
=>
false
));
//TODO: Move this to client code to avoid unnecessary work when a different metadata
// driver is used.
$reader
=
new
\Doctrine\Common\Annotations\AnnotationReader
(
new
\Doctrine\Common\Cache\ArrayCache
);
$reader
->
setDefaultAnnotationNamespace
(
'Doctrine\ORM\Mapping\\'
);
$this
->
_attributes
[
'metadataDriverImpl'
]
=
new
\Doctrine\ORM\Mapping\Driver\AnnotationDriver
(
$reader
);
}
/**
* Gets a boolean flag that
specifi
es whether partial objects are allowed.
* Gets a boolean flag that
indicat
es whether partial objects are allowed.
*
* If partial objects are allowed, Doctrine will never use proxies or lazy loading
* and you always only get what you explicitly query for.
...
...
@@ -98,16 +101,6 @@ class Configuration extends \Doctrine\DBAL\Configuration
return
$this
->
_attributes
[
'cacheDir'
];
}
public
function
getDqlClassAliasMap
()
{
return
$this
->
_attributes
[
'dqlClassAliasMap'
];
}
public
function
setDqlClassAliasMap
(
array
$map
)
{
$this
->
_attributes
[
'dqlClassAliasMap'
]
=
$map
;
}
/**
* Sets the cache driver implementation that is used for metadata caching.
*
...
...
@@ -187,12 +180,24 @@ class Configuration extends \Doctrine\DBAL\Configuration
{
$this
->
_attributes
[
'metadataCacheImpl'
]
=
$cacheImpl
;
}
/**
* Gets a boolean flag that indicates whether Doctrine should make use of the
* C extension.
*
* @return boolean TRUE if Doctrine is configured to use the C extension, FALSE otherwise.
*/
public
function
getUseCExtension
()
{
return
$this
->
_attributes
[
'useCExtension'
];
}
/**
* Sets a boolean flag that indicates whether Doctrine should make use of the
* C extension.
*
* @param boolean $boolean Whether to make use of the C extension or not.
*/
public
function
setUseCExtension
(
$boolean
)
{
$this
->
_attributes
[
'useCExtension'
]
=
$boolean
;
...
...
lib/Doctrine/ORM/EntityManager.php
View file @
35aa9a48
...
...
@@ -561,7 +561,9 @@ class EntityManager
}
/**
* Gets the proxy generated used by the EntityManager to create entity proxies.
* Gets the proxy generator used by the EntityManager to create entity proxies.
*
* @return DynamicProxyGenerator
*/
public
function
getProxyGenerator
()
{
...
...
lib/Doctrine/ORM/EntityManagerException.php
View file @
35aa9a48
...
...
@@ -32,29 +32,4 @@ namespace Doctrine\ORM;
* @version $Revision$
*/
class
EntityManagerException
extends
\Doctrine\Common\DoctrineException
{
public
static
function
invalidFlushMode
()
{
return
new
self
(
"Invalid flush mode."
);
}
public
static
function
noEntityManagerAvailable
()
{
return
new
self
(
"No EntityManager available."
);
}
public
static
function
entityAlreadyBound
(
$entityName
)
{
return
new
self
(
"The entity '
$entityName
' is already bound."
);
}
public
static
function
noManagerWithName
(
$emName
)
{
return
new
self
(
"EntityManager named '
$emName
' not found."
);
}
public
static
function
unknownAttribute
(
$name
)
{
return
new
self
(
"Unknown EntityManager attribute '
$name
'."
);
}
}
\ No newline at end of file
{}
\ No newline at end of file
lib/Doctrine/ORM/Event/PreInsertEventArgs.php
0 → 100644
View file @
35aa9a48
<?php
namespace
Doctrine\ORM\Event
;
use
Doctrine\Common\EventArgs
;
/**
* Class that holds event arguments for a preInsert event.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
class
PreInsertEventArgs
extends
EventArgs
{
private
$_entity
;
private
$_entityChangeSet
;
public
function
__construct
(
$entity
,
array
$changeSet
)
{
$this
->
_entity
=
$entity
;
$this
->
_entityChangeSet
=
$changeSet
;
}
public
function
getEntity
()
{
return
$this
->
_entity
;
}
public
function
getEntityChangeSet
()
{
return
$this
->
_entityChangeSet
;
}
/*public function getEntityId()
{
}*/
}
lib/Doctrine/ORM/Event/PreUpdateEventArgs.php
0 → 100644
View file @
35aa9a48
<?php
namespace
Doctrine\ORM\Event
;
use
Doctrine\Common\EventArgs
;
/**
* Class that holds event arguments for a preUpdate event.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
class
PreUpdateEventArgs
extends
EventArgs
{
private
$_entity
;
private
$_entityChangeSet
;
public
function
__construct
(
$entity
,
array
$changeSet
)
{
$this
->
_entity
=
$entity
;
$this
->
_entityChangeSet
=
$changeSet
;
}
public
function
getEntity
()
{
return
$this
->
_entity
;
}
public
function
getEntityChangeSet
()
{
return
$this
->
_entityState
;
}
}
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php
View file @
35aa9a48
This diff is collapsed.
Click to expand it.
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