Vendor update && Started using DoctrineMigrations
This commit is contained in:
11
vendor/doctrine/orm/.gitignore
vendored
Normal file
11
vendor/doctrine/orm/.gitignore
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
build/
|
||||
logs/
|
||||
reports/
|
||||
dist/
|
||||
download/
|
||||
lib/api/
|
||||
lib/Doctrine/Common
|
||||
lib/Doctrine/DBAL
|
||||
/.settings/
|
||||
.buildpath
|
||||
.project
|
15
vendor/doctrine/orm/.gitmodules
vendored
Normal file
15
vendor/doctrine/orm/.gitmodules
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
[submodule "lib/vendor/doctrine-common"]
|
||||
path = lib/vendor/doctrine-common
|
||||
url = git://github.com/doctrine/common.git
|
||||
[submodule "lib/vendor/doctrine-dbal"]
|
||||
path = lib/vendor/doctrine-dbal
|
||||
url = git://github.com/doctrine/dbal.git
|
||||
[submodule "lib/vendor/Symfony/Component/Console"]
|
||||
path = lib/vendor/Symfony/Component/Console
|
||||
url = git://github.com/symfony/Console.git
|
||||
[submodule "lib/vendor/Symfony/Component/Yaml"]
|
||||
path = lib/vendor/Symfony/Component/Yaml
|
||||
url = git://github.com/symfony/Yaml.git
|
||||
[submodule "lib/vendor/doctrine-build-common"]
|
||||
path = lib/vendor/doctrine-build-common
|
||||
url = https://github.com/doctrine/doctrine-build-common.git
|
240
vendor/doctrine/orm/UPGRADE_TO_2_0
vendored
Normal file
240
vendor/doctrine/orm/UPGRADE_TO_2_0
vendored
Normal file
@@ -0,0 +1,240 @@
|
||||
# Update from 2.0-BETA3 to 2.0-BETA4
|
||||
|
||||
## XML Driver <change-tracking-policy /> element demoted to attribute
|
||||
|
||||
We changed how the XML Driver allows to define the change-tracking-policy. The working case is now:
|
||||
|
||||
<entity change-tracking-policy="DEFERRED_IMPLICT" />
|
||||
|
||||
# Update from 2.0-BETA2 to 2.0-BETA3
|
||||
|
||||
## Serialization of Uninitialized Proxies
|
||||
|
||||
As of Beta3 you can now serialize uninitialized proxies, an exception will only be thrown when
|
||||
trying to access methods on the unserialized proxy as long as it has not been re-attached to the
|
||||
EntityManager using `EntityManager#merge()`. See this example:
|
||||
|
||||
$proxy = $em->getReference('User', 1);
|
||||
|
||||
$serializedProxy = serialize($proxy);
|
||||
$detachedProxy = unserialized($serializedProxy);
|
||||
|
||||
echo $em->contains($detachedProxy); // FALSE
|
||||
|
||||
try {
|
||||
$detachedProxy->getId(); // uninitialized detached proxy
|
||||
} catch(Exception $e) {
|
||||
|
||||
}
|
||||
$attachedProxy = $em->merge($detachedProxy);
|
||||
echo $attackedProxy->getId(); // works!
|
||||
|
||||
## Changed SQL implementation of Postgres and Oracle DateTime types
|
||||
|
||||
The DBAL Type "datetime" included the Timezone Offset in both Postgres and Oracle. As of this version they are now
|
||||
generated without Timezone (TIMESTAMP WITHOUT TIME ZONE instead of TIMESTAMP WITH TIME ZONE).
|
||||
See [this comment to Ticket DBAL-22](http://www.doctrine-project.org/jira/browse/DBAL-22?focusedCommentId=13396&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_13396)
|
||||
for more details as well as migration issues for PostgreSQL and Oracle.
|
||||
|
||||
Both Postgres and Oracle will throw Exceptions during hydration of Objects with "DateTime" fields unless migration steps are taken!
|
||||
|
||||
## Removed multi-dot/deep-path expressions in DQL
|
||||
|
||||
The support for implicit joins in DQL through the multi-dot/Deep Path Expressions
|
||||
was dropped. For example:
|
||||
|
||||
SELECT u FROM User u WHERE u.group.name = ?1
|
||||
|
||||
See the "u.group.id" here is using multi dots (deep expression) to walk
|
||||
through the graph of objects and properties. Internally the DQL parser
|
||||
would rewrite these queries to:
|
||||
|
||||
SELECT u FROM User u JOIN u.group g WHERE g.name = ?1
|
||||
|
||||
This explicit notation will be the only supported notation as of now. The internal
|
||||
handling of multi-dots in the DQL Parser was very complex, error prone in edge cases
|
||||
and required special treatment for several features we added. Additionally
|
||||
it had edge cases that could not be solved without making the DQL Parser
|
||||
even much more complex. For this reason we will drop the support for the
|
||||
deep path expressions to increase maintainability and overall performance
|
||||
of the DQL parsing process. This will benefit any DQL query being parsed,
|
||||
even those not using deep path expressions.
|
||||
|
||||
Note that the generated SQL of both notations is exactly the same! You
|
||||
don't loose anything through this.
|
||||
|
||||
## Default Allocation Size for Sequences
|
||||
|
||||
The default allocation size for sequences has been changed from 10 to 1. This step was made
|
||||
to not cause confusion with users and also because it is partly some kind of premature optimization.
|
||||
|
||||
# Update from 2.0-BETA1 to 2.0-BETA2
|
||||
|
||||
There are no backwards incompatible changes in this release.
|
||||
|
||||
# Upgrade from 2.0-ALPHA4 to 2.0-BETA1
|
||||
|
||||
## EntityRepository deprecates access to protected variables
|
||||
|
||||
Instead of accessing protected variables for the EntityManager in
|
||||
a custom EntityRepository it is now required to use the getter methods
|
||||
for all the three instance variables:
|
||||
|
||||
* `$this->_em` now accessible through `$this->getEntityManager()`
|
||||
* `$this->_class` now accessible through `$this->getClassMetadata()`
|
||||
* `$this->_entityName` now accessible through `$this->getEntityName()`
|
||||
|
||||
Important: For Beta 2 the protected visibility of these three properties will be
|
||||
changed to private!
|
||||
|
||||
## Console migrated to Symfony Console
|
||||
|
||||
The Doctrine CLI has been replaced by Symfony Console Configuration
|
||||
|
||||
Instead of having to specify:
|
||||
|
||||
[php]
|
||||
$cliConfig = new CliConfiguration();
|
||||
$cliConfig->setAttribute('em', $entityManager);
|
||||
|
||||
You now have to configure the script like:
|
||||
|
||||
[php]
|
||||
$helperSet = new \Symfony\Components\Console\Helper\HelperSet(array(
|
||||
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
|
||||
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
|
||||
));
|
||||
|
||||
## Console: No need for Mapping Paths anymore
|
||||
|
||||
In previous versions you had to specify the --from and --from-path options
|
||||
to show where your mapping paths are from the console. However this information
|
||||
is already known from the Mapping Driver configuration, so the requirement
|
||||
for this options were dropped.
|
||||
|
||||
Instead for each console command all the entities are loaded and to
|
||||
restrict the operation to one or more sub-groups you can use the --filter flag.
|
||||
|
||||
## AnnotationDriver is not a default mapping driver anymore
|
||||
|
||||
In conjunction with the recent changes to Console we realized that the
|
||||
annotations driver being a default metadata driver lead to lots of glue
|
||||
code in the console components to detect where entities lie and how to load
|
||||
them for batch updates like SchemaTool and other commands. However the
|
||||
annotations driver being a default driver does not really help that much
|
||||
anyways.
|
||||
|
||||
Therefore we decided to break backwards compability in this issue and drop
|
||||
the support for Annotations as Default Driver and require our users to
|
||||
specify the driver explicitly (which allows us to ask for the path to all
|
||||
entities).
|
||||
|
||||
If you are using the annotations metadata driver as default driver, you
|
||||
have to add the following lines to your bootstrap code:
|
||||
|
||||
$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities"));
|
||||
$config->setMetadataDriverImpl($driverImpl);
|
||||
|
||||
You have to specify the path to your entities as either string of a single
|
||||
path or array of multiple paths
|
||||
to your entities. This information will be used by all console commands to
|
||||
access all entities.
|
||||
|
||||
Xml and Yaml Drivers work as before!
|
||||
|
||||
|
||||
## New inversedBy attribute
|
||||
|
||||
It is now *mandatory* that the owning side of a bidirectional association specifies the
|
||||
'inversedBy' attribute that points to the name of the field on the inverse side that completes
|
||||
the association. Example:
|
||||
|
||||
[php]
|
||||
// BEFORE (ALPHA4 AND EARLIER)
|
||||
class User
|
||||
{
|
||||
//...
|
||||
/** @OneToOne(targetEntity="Address", mappedBy="user") */
|
||||
private $address;
|
||||
//...
|
||||
}
|
||||
class Address
|
||||
{
|
||||
//...
|
||||
/** @OneToOne(targetEntity="User") */
|
||||
private $user;
|
||||
//...
|
||||
}
|
||||
|
||||
// SINCE BETA1
|
||||
// User class DOES NOT CHANGE
|
||||
class Address
|
||||
{
|
||||
//...
|
||||
/** @OneToOne(targetEntity="User", inversedBy="address") */
|
||||
private $user;
|
||||
//...
|
||||
}
|
||||
|
||||
Thus, the inversedBy attribute is the counterpart to the mappedBy attribute. This change
|
||||
was necessary to enable some simplifications and further performance improvements. We
|
||||
apologize for the inconvenience.
|
||||
|
||||
## Default Property for Field Mappings
|
||||
|
||||
The "default" option for database column defaults has been removed. If desired, database column defaults can
|
||||
be implemented by using the columnDefinition attribute of the @Column annotation (or the approriate XML and YAML equivalents).
|
||||
Prefer PHP default values, if possible.
|
||||
|
||||
## Selecting Partial Objects
|
||||
|
||||
Querying for partial objects now has a new syntax. The old syntax to query for partial objects
|
||||
now has a different meaning. This is best illustrated by an example. If you previously
|
||||
had a DQL query like this:
|
||||
|
||||
[sql]
|
||||
SELECT u.id, u.name FROM User u
|
||||
|
||||
Since BETA1, simple state field path expressions in the select clause are used to select
|
||||
object fields as plain scalar values (something that was not possible before).
|
||||
To achieve the same result as previously (that is, a partial object with only id and name populated)
|
||||
you need to use the following, explicit syntax:
|
||||
|
||||
[sql]
|
||||
SELECT PARTIAL u.{id,name} FROM User u
|
||||
|
||||
## XML Mapping Driver
|
||||
|
||||
The 'inheritance-type' attribute changed to take last bit of ClassMetadata constant names, i.e.
|
||||
NONE, SINGLE_TABLE, INHERITANCE_TYPE_JOINED
|
||||
|
||||
## YAML Mapping Driver
|
||||
|
||||
The way to specify lifecycle callbacks in YAML Mapping driver was changed to allow for multiple callbacks
|
||||
per event. The Old syntax ways:
|
||||
|
||||
[yaml]
|
||||
lifecycleCallbacks:
|
||||
doStuffOnPrePersist: prePersist
|
||||
doStuffOnPostPersist: postPersist
|
||||
|
||||
The new syntax is:
|
||||
|
||||
[yaml]
|
||||
lifecycleCallbacks:
|
||||
prePersist: [ doStuffOnPrePersist, doOtherStuffOnPrePersistToo ]
|
||||
postPersist: [ doStuffOnPostPersist ]
|
||||
|
||||
## PreUpdate Event Listeners
|
||||
|
||||
Event Listeners listening to the 'preUpdate' event can only affect the primitive values of entity changesets
|
||||
by using the API on the `PreUpdateEventArgs` instance passed to the preUpdate listener method. Any changes
|
||||
to the state of the entitys properties won't affect the database UPDATE statement anymore. This gives drastic
|
||||
performance benefits for the preUpdate event.
|
||||
|
||||
## Collection API
|
||||
|
||||
The Collection interface in the Common package has been updated with some missing methods
|
||||
that were present only on the default implementation, ArrayCollection. Custom collection
|
||||
implementations need to be updated to adhere to the updated interface.
|
||||
|
25
vendor/doctrine/orm/UPGRADE_TO_2_1
vendored
Normal file
25
vendor/doctrine/orm/UPGRADE_TO_2_1
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
This document details all the possible changes that you should investigate when updating
|
||||
your project from Doctrine 2.0.x to 2.1
|
||||
|
||||
## Interface for EntityRepository
|
||||
|
||||
The EntityRepository now has an interface Doctrine\Common\Persistence\ObjectRepository. This means that your classes that override EntityRepository and extend find(), findOneBy() or findBy() must be adjusted to follow this interface.
|
||||
|
||||
## AnnotationReader changes
|
||||
|
||||
The annotation reader was heavily refactored between 2.0 and 2.1-RC1. In theory the operation of the new reader should be backwards compatible, but it has to be setup differently to work that way:
|
||||
|
||||
// new call to the AnnotationRegistry
|
||||
\Doctrine\Common\Annotations\AnnotationRegistry::registerFile('/doctrine-src/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
|
||||
|
||||
$reader = new \Doctrine\Common\Annotations\AnnotationReader();
|
||||
$reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\');
|
||||
// new code necessary starting here
|
||||
$reader->setIgnoreNotImportedAnnotations(true);
|
||||
$reader->setEnableParsePhpImports(false);
|
||||
$reader = new \Doctrine\Common\Annotations\CachedReader(
|
||||
new \Doctrine\Common\Annotations\IndexedReader($reader), new ArrayCache()
|
||||
);
|
||||
|
||||
This is already done inside the ``$config->newDefaultAnnotationDriver``, so everything should automatically work if you are using this method. You can verify if everything still works by executing a console command such as schema-validate that loads all metadata into memory.
|
||||
|
81
vendor/doctrine/orm/UPGRADE_TO_2_2
vendored
Normal file
81
vendor/doctrine/orm/UPGRADE_TO_2_2
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
# ResultCache implementation rewritten
|
||||
|
||||
The result cache is completely rewritten and now works on the database result level, not inside the ORM AbstractQuery
|
||||
anymore. This means that for result cached queries the hydration will now always be performed again, regardless of
|
||||
the hydration mode. Affected areas are:
|
||||
|
||||
1. Fixes the problem that entities coming from the result cache were not registered in the UnitOfWork
|
||||
leading to problems during EntityManager#flush. Calls to EntityManager#merge are not necessary anymore.
|
||||
2. Affects the array hydrator which now includes the overhead of hydration compared to caching the final result.
|
||||
|
||||
The API is backwards compatible however most of the getter methods on the `AbstractQuery` object are now
|
||||
deprecated in favor of calling AbstractQuery#getQueryCacheProfile(). This method returns a `Doctrine\DBAL\Cache\QueryCacheProfile`
|
||||
instance with access to result cache driver, lifetime and cache key.
|
||||
|
||||
|
||||
# EntityManager#getPartialReference() creates read-only entity
|
||||
|
||||
Entities returned from EntityManager#getPartialReference() are now marked as read-only if they
|
||||
haven't been in the identity map before. This means objects of this kind never lead to changes
|
||||
in the UnitOfWork.
|
||||
|
||||
|
||||
# Fields omitted in a partial DQL query or a native query are never updated
|
||||
|
||||
Fields of an entity that are not returned from a partial DQL Query or native SQL query
|
||||
will never be updated through an UPDATE statement.
|
||||
|
||||
|
||||
# Removed support for onUpdate in @JoinColumn
|
||||
|
||||
The onUpdate foreign key handling makes absolutely no sense in an ORM. Additionally Oracle doesn't even support it. Support for it is removed.
|
||||
|
||||
|
||||
# Changes in Annotation Handling
|
||||
|
||||
There have been some changes to the annotation handling in Common 2.2 again, that affect how people with old configurations
|
||||
from 2.0 have to configure the annotation driver if they don't use `Configuration::newDefaultAnnotationDriver()`:
|
||||
|
||||
// Register the ORM Annotations in the AnnotationRegistry
|
||||
AnnotationRegistry::registerFile('path/to/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
|
||||
|
||||
$reader = new \Doctrine\Common\Annotations\SimpleAnnotationReader();
|
||||
$reader->addNamespace('Doctrine\ORM\Mapping');
|
||||
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());
|
||||
|
||||
$driver = new AnnotationDriver($reader, (array)$paths);
|
||||
|
||||
$config->setMetadataDriverImpl($driver);
|
||||
|
||||
|
||||
# Scalar mappings can now be ommitted from DQL result
|
||||
|
||||
You are now allowed to mark scalar SELECT expressions as HIDDEN an they are not hydrated anymore.
|
||||
Example:
|
||||
|
||||
SELECT u, SUM(a.id) AS HIDDEN numArticles FROM User u LEFT JOIN u.Articles a ORDER BY numArticles DESC HAVING numArticles > 10
|
||||
|
||||
Your result will be a collection of Users, and not an array with key 0 as User object instance and "numArticles" as the number of articles per user
|
||||
|
||||
|
||||
# Map entities as scalars in DQL result
|
||||
|
||||
When hydrating to array or even a mixed result in object hydrator, previously you had the 0 index holding you entity instance.
|
||||
You are now allowed to alias this, providing more flexibility for you code.
|
||||
Example:
|
||||
|
||||
SELECT u AS user FROM User u
|
||||
|
||||
Will now return a collection of arrays with index "user" pointing to the User object instance.
|
||||
|
||||
|
||||
# Performance optimizations
|
||||
|
||||
Thousands of lines were completely reviewed and optimized for best performance.
|
||||
Removed redundancy and improved code readability made now internal Doctrine code easier to understand.
|
||||
Also, Doctrine 2.2 now is around 10-15% faster than 2.1.
|
||||
|
||||
# EntityManager#find(null)
|
||||
|
||||
Previously EntityManager#find(null) returned null. It now throws an exception.
|
||||
|
35
vendor/doctrine/orm/UPGRADE_TO_ALPHA3
vendored
Normal file
35
vendor/doctrine/orm/UPGRADE_TO_ALPHA3
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
# Upgrade from 2.0-ALPHA2 to 2.0-ALPHA3
|
||||
|
||||
This section details the changes made to Doctrine 2.0-ALPHA3 to make it easier for you
|
||||
to upgrade your projects to use this version.
|
||||
|
||||
## CLI Changes
|
||||
|
||||
The $args variable used in the cli-config.php for configuring the Doctrine CLI has been renamed to $globalArguments.
|
||||
|
||||
## Proxy class changes
|
||||
|
||||
You are now required to make supply some minimalist configuration with regards to proxy objects. That involves 2 new configuration options. First, the directory where generated proxy classes should be placed needs to be specified. Secondly, you need to configure the namespace used for proxy classes. The following snippet shows an example:
|
||||
|
||||
[php]
|
||||
// step 1: configure directory for proxy classes
|
||||
// $config instanceof Doctrine\ORM\Configuration
|
||||
$config->setProxyDir('/path/to/myproject/lib/MyProject/Generated/Proxies');
|
||||
$config->setProxyNamespace('MyProject\Generated\Proxies');
|
||||
|
||||
Note that proxy classes behave exactly like any other classes when it comes to class loading. Therefore you need to make sure the proxy classes can be loaded by some class loader. If you place the generated proxy classes in a namespace and directory under your projects class files, like in the example above, it would be sufficient to register the MyProject namespace on a class loader. Since the proxy classes are contained in that namespace and adhere to the standards for class loading, no additional work is required.
|
||||
Generating the proxy classes into a namespace within your class library is the recommended setup.
|
||||
|
||||
Entities with initialized proxy objects can now be serialized and unserialized properly from within the same application.
|
||||
|
||||
For more details refer to the Configuration section of the manual.
|
||||
|
||||
## Removed allowPartialObjects configuration option
|
||||
|
||||
The allowPartialObjects configuration option together with the `Configuration#getAllowPartialObjects` and `Configuration#setAllowPartialObjects` methods have been removed.
|
||||
The new behavior is as if the option were set to FALSE all the time, basically disallowing partial objects globally. However, you can still use the `Query::HINT_FORCE_PARTIAL_LOAD` query hint to force a query to return partial objects for optimization purposes.
|
||||
|
||||
## Renamed Methods
|
||||
|
||||
* Doctrine\ORM\Configuration#getCacheDir() to getProxyDir()
|
||||
* Doctrine\ORM\Configuration#setCacheDir($dir) to setProxyDir($dir)
|
36
vendor/doctrine/orm/UPGRADE_TO_ALPHA4
vendored
Normal file
36
vendor/doctrine/orm/UPGRADE_TO_ALPHA4
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
# Upgrade from 2.0-ALPHA3 to 2.0-ALPHA4
|
||||
|
||||
## CLI Controller changes
|
||||
|
||||
CLI main object changed its name and namespace. Renamed from Doctrine\ORM\Tools\Cli to Doctrine\Common\Cli\CliController.
|
||||
Doctrine\Common\Cli\CliController now only deals with namespaces. Ready to go, Core, Dbal and Orm are available and you can subscribe new tasks by retrieving the namespace and including new task. Example:
|
||||
|
||||
[php]
|
||||
$cli->getNamespace('Core')->addTask('my-example', '\MyProject\Tools\Cli\Tasks\MyExampleTask');
|
||||
|
||||
|
||||
## CLI Tasks documentation
|
||||
|
||||
Tasks have implemented a new way to build documentation. Although it is still possible to define the help manually by extending the basicHelp and extendedHelp, they are now optional.
|
||||
With new required method AbstractTask::buildDocumentation, its implementation defines the TaskDocumentation instance (accessible through AbstractTask::getDocumentation()), basicHelp and extendedHelp are now not necessary to be implemented.
|
||||
|
||||
## Changes in Method Signatures
|
||||
|
||||
* A bunch of Methods on both Doctrine\DBAL\Platforms\AbstractPlatform and Doctrine\DBAL\Schema\AbstractSchemaManager
|
||||
have changed quite significantly by adopting the new Schema instance objects.
|
||||
|
||||
## Renamed Methods
|
||||
|
||||
* Doctrine\ORM\AbstractQuery::setExpireResultCache() -> expireResultCache()
|
||||
* Doctrine\ORM\Query::setExpireQueryCache() -> expireQueryCache()
|
||||
|
||||
## SchemaTool Changes
|
||||
|
||||
* "doctrine schema-tool --drop" now always drops the complete database instead of
|
||||
only those tables defined by the current database model. The previous method had
|
||||
problems when foreign keys of orphaned tables pointed to tables that were schedulded
|
||||
for deletion.
|
||||
* Use "doctrine schema-tool --update" to get a save incremental update for your
|
||||
database schema without deleting any unused tables, sequences or foreign keys.
|
||||
* Use "doctrine schema-tool --complete-update" to do a full incremental update of
|
||||
your schema.
|
4
vendor/doctrine/orm/bin/doctrine
vendored
Normal file
4
vendor/doctrine/orm/bin/doctrine
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
include('doctrine.php');
|
9
vendor/doctrine/orm/bin/doctrine.bat
vendored
Normal file
9
vendor/doctrine/orm/bin/doctrine.bat
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
|
||||
if "%PHPBIN%" == "" set PHPBIN=@php_bin@
|
||||
if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
|
||||
GOTO RUN
|
||||
:USE_PEAR_PATH
|
||||
set PHPBIN=%PHP_PEAR_PHP_BIN%
|
||||
:RUN
|
||||
"%PHPBIN%" "@bin_dir@\doctrine" %*
|
50
vendor/doctrine/orm/bin/doctrine.php
vendored
Normal file
50
vendor/doctrine/orm/bin/doctrine.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/*
|
||||
* 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>.
|
||||
*/
|
||||
|
||||
require_once 'Doctrine/Common/ClassLoader.php';
|
||||
|
||||
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
|
||||
$classLoader->register();
|
||||
|
||||
$classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'Doctrine');
|
||||
$classLoader->register();
|
||||
|
||||
$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
|
||||
|
||||
$helperSet = null;
|
||||
if (file_exists($configFile)) {
|
||||
if ( ! is_readable($configFile)) {
|
||||
trigger_error(
|
||||
'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require $configFile;
|
||||
|
||||
foreach ($GLOBALS as $helperSetCandidate) {
|
||||
if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) {
|
||||
$helperSet = $helperSetCandidate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$helperSet = ($helperSet) ?: new \Symfony\Component\Console\Helper\HelperSet();
|
||||
|
||||
\Doctrine\ORM\Tools\Console\ConsoleRunner::run($helperSet);
|
11
vendor/doctrine/orm/build.properties
vendored
Normal file
11
vendor/doctrine/orm/build.properties
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Project Name
|
||||
project.name=DoctrineORM
|
||||
|
||||
# Dependency minimum versions
|
||||
dependencies.common=2.2.0beta1
|
||||
dependencies.dbal=2.2.0beta1
|
||||
dependencies.sfconsole=2.0.0
|
||||
|
||||
# Version class and file
|
||||
project.version_class = Doctrine\ORM\Version
|
||||
project.version_file = lib/Doctrine/ORM/Version.php
|
16
vendor/doctrine/orm/build.properties.dev
vendored
Normal file
16
vendor/doctrine/orm/build.properties.dev
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
version=2.0.0BETA2
|
||||
dependencies.common=2.0.0BETA4
|
||||
dependencies.dbal=2.0.0BETA4
|
||||
stability=beta
|
||||
build.dir=build
|
||||
dist.dir=dist
|
||||
report.dir=reports
|
||||
log.archive.dir=logs
|
||||
project.pirum_dir=
|
||||
project.download_dir=
|
||||
project.xsd_dir=
|
||||
test.phpunit_configuration_file=
|
||||
test.phpunit_generate_coverage=0
|
||||
test.pmd_reports=0
|
||||
test.pdepend_exec=
|
||||
test.phpmd_exec=
|
114
vendor/doctrine/orm/build.xml
vendored
Normal file
114
vendor/doctrine/orm/build.xml
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="DoctrineORM" default="build" basedir=".">
|
||||
<taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
|
||||
<import file="${project.basedir}/lib/vendor/doctrine-build-common/packaging.xml" />
|
||||
|
||||
<property file="build.properties" />
|
||||
|
||||
<!--
|
||||
Fileset for artifacts shared across all distributed packages.
|
||||
-->
|
||||
<fileset id="shared-artifacts" dir=".">
|
||||
<include name="LICENSE"/>
|
||||
<include name="UPGRADE*" />
|
||||
<include name="doctrine-mapping.xsd" />
|
||||
</fileset>
|
||||
|
||||
<!--
|
||||
Fileset for command line scripts
|
||||
-->
|
||||
<fileset id="bin-scripts" dir="./bin">
|
||||
<include name="doctrine"/>
|
||||
<include name="doctrine.php"/>
|
||||
<include name="doctrine.bat"/>
|
||||
</fileset>
|
||||
|
||||
<!--
|
||||
Fileset for the sources of the Doctrine Common dependency.
|
||||
-->
|
||||
<fileset id="common-sources" dir="./lib/vendor/doctrine-common/lib">
|
||||
<include name="Doctrine/Common/**"/>
|
||||
</fileset>
|
||||
|
||||
<!--
|
||||
Fileset for the sources of the Doctrine DBAL dependency.
|
||||
-->
|
||||
<fileset id="dbal-sources" dir="./lib/vendor/doctrine-dbal/lib">
|
||||
<include name="Doctrine/DBAL/**"/>
|
||||
</fileset>
|
||||
|
||||
<!--
|
||||
Fileset for the sources of the Doctrine ORM.
|
||||
-->
|
||||
<fileset id="orm-sources" dir="./lib">
|
||||
<include name="Doctrine/ORM/**"/>
|
||||
</fileset>
|
||||
|
||||
<!--
|
||||
Fileset for source of the Symfony YAML and Console components.
|
||||
-->
|
||||
<fileset id="symfony-sources" dir="./lib/vendor">
|
||||
<include name="Symfony/Component/**"/>
|
||||
<exclude name="**/.git/**" />
|
||||
</fileset>
|
||||
|
||||
<!--
|
||||
Builds ORM package, preparing it for distribution.
|
||||
-->
|
||||
<target name="copy-files" depends="prepare">
|
||||
<copy todir="${build.dir}/${project.name}-${version}">
|
||||
<fileset refid="shared-artifacts"/>
|
||||
</copy>
|
||||
<copy todir="${build.dir}/${project.name}-${version}">
|
||||
<fileset refid="common-sources"/>
|
||||
<fileset refid="dbal-sources"/>
|
||||
<fileset refid="orm-sources"/>
|
||||
</copy>
|
||||
<copy todir="${build.dir}/${project.name}-${version}/Doctrine">
|
||||
<fileset refid="symfony-sources"/>
|
||||
</copy>
|
||||
<copy todir="${build.dir}/${project.name}-${version}/bin">
|
||||
<fileset refid="bin-scripts"/>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<!--
|
||||
Builds distributable PEAR packages.
|
||||
-->
|
||||
<target name="define-pear-package" depends="copy-files">
|
||||
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${project.name}-${version}">
|
||||
<name>DoctrineORM</name>
|
||||
<summary>Doctrine Object Relational Mapper</summary>
|
||||
<channel>pear.doctrine-project.org</channel>
|
||||
<description>The Doctrine ORM package is the primary package containing the object relational mapper.</description>
|
||||
<lead user="jwage" name="Jonathan H. Wage" email="jonwage@gmail.com" />
|
||||
<lead user="guilhermeblanco" name="Guilherme Blanco" email="guilhermeblanco@gmail.com" />
|
||||
<lead user="romanb" name="Roman Borschel" email="roman@code-factory.org" />
|
||||
<lead user="beberlei" name="Benjamin Eberlei" email="kontakt@beberlei.de" />
|
||||
<license>LGPL</license>
|
||||
<version release="${pear.version}" api="${pear.version}" />
|
||||
<stability release="${pear.stability}" api="${pear.stability}" />
|
||||
<notes>-</notes>
|
||||
<dependencies>
|
||||
<php minimum_version="5.3.0" />
|
||||
<pear minimum_version="1.6.0" recommended_version="1.6.1" />
|
||||
<package name="DoctrineCommon" channel="pear.doctrine-project.org" minimum_version="${dependencies.common}" maximum_version="2.2.99" />
|
||||
<package name="DoctrineDBAL" channel="pear.doctrine-project.org" minimum_version="${dependencies.dbal}" maximum_version="2.2.99" />
|
||||
<package name="Console" channel="pear.symfony.com" minimum_version="2.0.0" />
|
||||
<package name="Yaml" channel="pear.symfony.com" minimum_version="2.0.0" />
|
||||
</dependencies>
|
||||
<dirroles key="bin">script</dirroles>
|
||||
<ignore>Doctrine/Common/</ignore>
|
||||
<ignore>Doctrine/DBAL/</ignore>
|
||||
<ignore>Symfony/Component/Yaml/</ignore>
|
||||
<ignore>Symfony/Component/Console/</ignore>
|
||||
<release>
|
||||
<install as="doctrine" name="bin/doctrine" />
|
||||
<install as="doctrine.php" name="bin/doctrine.php" />
|
||||
<install as="doctrine.bat" name="bin/doctrine.bat" />
|
||||
</release>
|
||||
<replacement path="bin/doctrine" type="pear-config" from="@php_bin@" to="php_bin" />
|
||||
<replacement path="bin/doctrine.bat" type="pear-config" from="@bin_dir@" to="bin_dir" />
|
||||
</d51pearpkg2>
|
||||
</target>
|
||||
</project>
|
3
vendor/doctrine/orm/tests/.gitignore
vendored
Normal file
3
vendor/doctrine/orm/tests/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Doctrine/Tests/Proxies/
|
||||
Doctrine/Tests/ORM/Proxy/generated/
|
||||
Doctrine/Tests/ORM/Tools/Export/export
|
32
vendor/doctrine/orm/tests/Doctrine/Tests/DbalFunctionalTestCase.php
vendored
Normal file
32
vendor/doctrine/orm/tests/Doctrine/Tests/DbalFunctionalTestCase.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests;
|
||||
|
||||
class DbalFunctionalTestCase extends DbalTestCase
|
||||
{
|
||||
/* Shared connection when a TestCase is run alone (outside of it's functional suite) */
|
||||
private static $_sharedConn;
|
||||
|
||||
/**
|
||||
* @var Doctrine\DBAL\Connection
|
||||
*/
|
||||
protected $_conn;
|
||||
|
||||
protected function resetSharedConn()
|
||||
{
|
||||
$this->sharedFixture['conn'] = null;
|
||||
self::$_sharedConn = null;
|
||||
}
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
if (isset($this->sharedFixture['conn'])) {
|
||||
$this->_conn = $this->sharedFixture['conn'];
|
||||
} else {
|
||||
if ( ! isset(self::$_sharedConn)) {
|
||||
self::$_sharedConn = TestUtil::getConnection();
|
||||
}
|
||||
$this->_conn = self::$_sharedConn;
|
||||
}
|
||||
}
|
||||
}
|
10
vendor/doctrine/orm/tests/Doctrine/Tests/DbalTestCase.php
vendored
Normal file
10
vendor/doctrine/orm/tests/Doctrine/Tests/DbalTestCase.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests;
|
||||
|
||||
/**
|
||||
* Base testcase class for all dbal testcases.
|
||||
*/
|
||||
class DbalTestCase extends DoctrineTestCase
|
||||
{
|
||||
}
|
34
vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/NegativeToPositiveType.php
vendored
Normal file
34
vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/NegativeToPositiveType.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\DbalTypes;
|
||||
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
|
||||
class NegativeToPositiveType extends Type
|
||||
{
|
||||
public function getName()
|
||||
{
|
||||
return 'negative_to_positive';
|
||||
}
|
||||
|
||||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
|
||||
{
|
||||
return $platform->getIntegerTypeDeclarationSQL($fieldDeclaration);
|
||||
}
|
||||
|
||||
public function canRequireSQLConversion()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
|
||||
{
|
||||
return 'ABS(' . $sqlExpr . ')';
|
||||
}
|
||||
|
||||
public function convertToPHPValueSQL($sqlExpr, $platform)
|
||||
{
|
||||
return '-(' . $sqlExpr . ')';
|
||||
}
|
||||
}
|
29
vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php
vendored
Normal file
29
vendor/doctrine/orm/tests/Doctrine/Tests/DbalTypes/UpperCaseStringType.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\DbalTypes;
|
||||
|
||||
use Doctrine\DBAL\Types\StringType;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
|
||||
class UpperCaseStringType extends StringType
|
||||
{
|
||||
public function getName()
|
||||
{
|
||||
return 'upper_case_string';
|
||||
}
|
||||
|
||||
public function canRequireSQLConversion()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
|
||||
{
|
||||
return 'UPPER(' . $sqlExpr . ')';
|
||||
}
|
||||
|
||||
public function convertToPHPValueSQL($sqlExpr, $platform)
|
||||
{
|
||||
return 'LOWER(' . $sqlExpr . ')';
|
||||
}
|
||||
}
|
10
vendor/doctrine/orm/tests/Doctrine/Tests/DoctrineTestCase.php
vendored
Normal file
10
vendor/doctrine/orm/tests/Doctrine/Tests/DoctrineTestCase.php
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests;
|
||||
|
||||
/**
|
||||
* Base testcase class for all Doctrine testcases.
|
||||
*/
|
||||
abstract class DoctrineTestCase extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
}
|
14
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ClassMetadataMock.php
vendored
Normal file
14
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ClassMetadataMock.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
class ClassMetadataMock extends \Doctrine\ORM\Mapping\ClassMetadata
|
||||
{
|
||||
/* Mock API */
|
||||
|
||||
public function setIdGeneratorType($type)
|
||||
{
|
||||
$this->_generatorType = $type;
|
||||
}
|
||||
|
||||
}
|
106
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ConnectionMock.php
vendored
Normal file
106
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/ConnectionMock.php
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
class ConnectionMock extends \Doctrine\DBAL\Connection
|
||||
{
|
||||
private $_fetchOneResult;
|
||||
private $_platformMock;
|
||||
private $_lastInsertId = 0;
|
||||
private $_inserts = array();
|
||||
private $_executeUpdates = array();
|
||||
|
||||
public function __construct(array $params, $driver, $config = null, $eventManager = null)
|
||||
{
|
||||
$this->_platformMock = new DatabasePlatformMock();
|
||||
|
||||
parent::__construct($params, $driver, $config, $eventManager);
|
||||
|
||||
// Override possible assignment of platform to database platform mock
|
||||
$this->_platform = $this->_platformMock;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function getDatabasePlatform()
|
||||
{
|
||||
return $this->_platformMock;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function insert($tableName, array $data, array $types = array())
|
||||
{
|
||||
$this->_inserts[$tableName][] = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function executeUpdate($query, array $params = array(), array $types = array())
|
||||
{
|
||||
$this->_executeUpdates[] = array('query' => $query, 'params' => $params, 'types' => $types);
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function lastInsertId($seqName = null)
|
||||
{
|
||||
return $this->_lastInsertId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function fetchColumn($statement, array $params = array(), $colnum = 0)
|
||||
{
|
||||
return $this->_fetchOneResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function quote($input, $type = null)
|
||||
{
|
||||
if (is_string($input)) {
|
||||
return "'" . $input . "'";
|
||||
}
|
||||
return $input;
|
||||
}
|
||||
|
||||
/* Mock API */
|
||||
|
||||
public function setFetchOneResult($fetchOneResult)
|
||||
{
|
||||
$this->_fetchOneResult = $fetchOneResult;
|
||||
}
|
||||
|
||||
public function setDatabasePlatform($platform)
|
||||
{
|
||||
$this->_platformMock = $platform;
|
||||
}
|
||||
|
||||
public function setLastInsertId($id)
|
||||
{
|
||||
$this->_lastInsertId = $id;
|
||||
}
|
||||
|
||||
public function getInserts()
|
||||
{
|
||||
return $this->_inserts;
|
||||
}
|
||||
|
||||
public function getExecuteUpdates()
|
||||
{
|
||||
return $this->_executeUpdates;
|
||||
}
|
||||
|
||||
public function reset()
|
||||
{
|
||||
$this->_inserts = array();
|
||||
$this->_lastInsertId = 0;
|
||||
}
|
||||
}
|
97
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php
vendored
Normal file
97
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform
|
||||
{
|
||||
private $_sequenceNextValSql = "";
|
||||
private $_prefersIdentityColumns = true;
|
||||
private $_prefersSequences = false;
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function getNativeDeclaration(array $field) {}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function getPortableDeclaration(array $field) {}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function prefersIdentityColumns()
|
||||
{
|
||||
return $this->_prefersIdentityColumns;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function prefersSequences()
|
||||
{
|
||||
return $this->_prefersSequences;
|
||||
}
|
||||
|
||||
/** @override */
|
||||
public function getSequenceNextValSQL($sequenceName)
|
||||
{
|
||||
return $this->_sequenceNextValSql;
|
||||
}
|
||||
|
||||
/** @override */
|
||||
public function getBooleanTypeDeclarationSQL(array $field) {}
|
||||
|
||||
/** @override */
|
||||
public function getIntegerTypeDeclarationSQL(array $field) {}
|
||||
|
||||
/** @override */
|
||||
public function getBigIntTypeDeclarationSQL(array $field) {}
|
||||
|
||||
/** @override */
|
||||
public function getSmallIntTypeDeclarationSQL(array $field) {}
|
||||
|
||||
/** @override */
|
||||
protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef) {}
|
||||
|
||||
/** @override */
|
||||
public function getVarcharTypeDeclarationSQL(array $field) {}
|
||||
|
||||
/** @override */
|
||||
public function getClobTypeDeclarationSQL(array $field) {}
|
||||
|
||||
/* MOCK API */
|
||||
|
||||
public function setPrefersIdentityColumns($bool)
|
||||
{
|
||||
$this->_prefersIdentityColumns = $bool;
|
||||
}
|
||||
|
||||
public function setPrefersSequences($bool)
|
||||
{
|
||||
$this->_prefersSequences = $bool;
|
||||
}
|
||||
|
||||
public function setSequenceNextValSql($sql)
|
||||
{
|
||||
$this->_sequenceNextValSql = $sql;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'mock';
|
||||
}
|
||||
|
||||
protected function initializeDoctrineTypeMappings()
|
||||
{
|
||||
|
||||
}
|
||||
/**
|
||||
* Gets the SQL Snippet used to declare a BLOB column type.
|
||||
*/
|
||||
public function getBlobTypeDeclarationSQL(array $field)
|
||||
{
|
||||
throw DBALException::notSupported(__METHOD__);
|
||||
}
|
||||
}
|
17
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php
vendored
Normal file
17
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
class DriverConnectionMock implements \Doctrine\DBAL\Driver\Connection
|
||||
{
|
||||
public function prepare($prepareString) {}
|
||||
public function query() {}
|
||||
public function quote($input, $type=\PDO::PARAM_STR) {}
|
||||
public function exec($statement) {}
|
||||
public function lastInsertId($name = null) {}
|
||||
public function beginTransaction() {}
|
||||
public function commit() {}
|
||||
public function rollBack() {}
|
||||
public function errorCode() {}
|
||||
public function errorInfo() {}
|
||||
}
|
72
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverMock.php
vendored
Normal file
72
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/DriverMock.php
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
|
||||
class DriverMock implements \Doctrine\DBAL\Driver
|
||||
{
|
||||
private $_platformMock;
|
||||
|
||||
private $_schemaManagerMock;
|
||||
|
||||
public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
|
||||
{
|
||||
return new DriverConnectionMock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the Sqlite PDO DSN.
|
||||
*
|
||||
* @return string The DSN.
|
||||
* @override
|
||||
*/
|
||||
protected function _constructPdoDsn(array $params)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function getDatabasePlatform()
|
||||
{
|
||||
if ( ! $this->_platformMock) {
|
||||
$this->_platformMock = new DatabasePlatformMock;
|
||||
}
|
||||
return $this->_platformMock;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
|
||||
{
|
||||
if($this->_schemaManagerMock == null) {
|
||||
return new SchemaManagerMock($conn);
|
||||
} else {
|
||||
return $this->_schemaManagerMock;
|
||||
}
|
||||
}
|
||||
|
||||
/* MOCK API */
|
||||
|
||||
public function setDatabasePlatform(\Doctrine\DBAL\Platforms\AbstractPlatform $platform)
|
||||
{
|
||||
$this->_platformMock = $platform;
|
||||
}
|
||||
|
||||
public function setSchemaManager(\Doctrine\DBAL\Schema\AbstractSchemaManager $sm)
|
||||
{
|
||||
$this->_schemaManagerMock = $sm;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'mock';
|
||||
}
|
||||
|
||||
public function getDatabase(\Doctrine\DBAL\Connection $conn)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
106
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityManagerMock.php
vendored
Normal file
106
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityManagerMock.php
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
<?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\Tests\Mocks;
|
||||
|
||||
use Doctrine\ORM\Proxy\ProxyFactory;
|
||||
|
||||
/**
|
||||
* Special EntityManager mock used for testing purposes.
|
||||
*/
|
||||
class EntityManagerMock extends \Doctrine\ORM\EntityManager
|
||||
{
|
||||
private $_uowMock;
|
||||
private $_proxyFactoryMock;
|
||||
private $_idGenerators = array();
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function getUnitOfWork()
|
||||
{
|
||||
return isset($this->_uowMock) ? $this->_uowMock : parent::getUnitOfWork();
|
||||
}
|
||||
|
||||
/* Mock API */
|
||||
|
||||
/**
|
||||
* Sets a (mock) UnitOfWork that will be returned when getUnitOfWork() is called.
|
||||
*
|
||||
* @param <type> $uow
|
||||
*/
|
||||
public function setUnitOfWork($uow)
|
||||
{
|
||||
$this->_uowMock = $uow;
|
||||
}
|
||||
|
||||
public function setProxyFactory($proxyFactory)
|
||||
{
|
||||
$this->_proxyFactoryMock = $proxyFactory;
|
||||
}
|
||||
|
||||
public function getProxyFactory()
|
||||
{
|
||||
return isset($this->_proxyFactoryMock) ? $this->_proxyFactoryMock : parent::getProxyFactory();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mock factory method to create an EntityManager.
|
||||
*
|
||||
* @param unknown_type $conn
|
||||
* @param unknown_type $name
|
||||
* @param Doctrine_Configuration $config
|
||||
* @param Doctrine_EventManager $eventManager
|
||||
* @return Doctrine\ORM\EntityManager
|
||||
*/
|
||||
public static function create($conn, \Doctrine\ORM\Configuration $config = null,
|
||||
\Doctrine\Common\EventManager $eventManager = null)
|
||||
{
|
||||
if (is_null($config)) {
|
||||
$config = new \Doctrine\ORM\Configuration();
|
||||
$config->setProxyDir(__DIR__ . '/../Proxies');
|
||||
$config->setProxyNamespace('Doctrine\Tests\Proxies');
|
||||
$config->setMetadataDriverImpl($config->newDefaultAnnotationDriver());
|
||||
}
|
||||
if (is_null($eventManager)) {
|
||||
$eventManager = new \Doctrine\Common\EventManager();
|
||||
}
|
||||
|
||||
return new EntityManagerMock($conn, $config, $eventManager);
|
||||
}
|
||||
/*
|
||||
public function setIdGenerator($className, $generator)
|
||||
{
|
||||
$this->_idGenerators[$className] = $generator;
|
||||
}
|
||||
*/
|
||||
/** @override */
|
||||
/* public function getIdGenerator($className)
|
||||
{
|
||||
|
||||
if (isset($this->_idGenerators[$className])) {
|
||||
return $this->_idGenerators[$className];
|
||||
}
|
||||
|
||||
return parent::getIdGenerator($className);
|
||||
}
|
||||
*/
|
||||
}
|
100
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php
vendored
Normal file
100
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
/**
|
||||
* EntityPersister implementation used for mocking during tests.
|
||||
*/
|
||||
class EntityPersisterMock extends \Doctrine\ORM\Persisters\BasicEntityPersister
|
||||
{
|
||||
private $_inserts = array();
|
||||
private $_updates = array();
|
||||
private $_deletes = array();
|
||||
private $_identityColumnValueCounter = 0;
|
||||
private $_mockIdGeneratorType;
|
||||
private $_postInsertIds = array();
|
||||
private $existsCalled = false;
|
||||
|
||||
/**
|
||||
* @param <type> $entity
|
||||
* @return <type>
|
||||
* @override
|
||||
*/
|
||||
public function insert($entity)
|
||||
{
|
||||
$this->_inserts[] = $entity;
|
||||
if ( ! is_null($this->_mockIdGeneratorType) && $this->_mockIdGeneratorType == \Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_IDENTITY
|
||||
|| $this->_class->isIdGeneratorIdentity()) {
|
||||
$id = $this->_identityColumnValueCounter++;
|
||||
$this->_postInsertIds[$id] = $entity;
|
||||
return $id;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function addInsert($entity)
|
||||
{
|
||||
$this->_inserts[] = $entity;
|
||||
if ( ! is_null($this->_mockIdGeneratorType) && $this->_mockIdGeneratorType == \Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_IDENTITY
|
||||
|| $this->_class->isIdGeneratorIdentity()) {
|
||||
$id = $this->_identityColumnValueCounter++;
|
||||
$this->_postInsertIds[$id] = $entity;
|
||||
return $id;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function executeInserts()
|
||||
{
|
||||
return $this->_postInsertIds;
|
||||
}
|
||||
|
||||
public function setMockIdGeneratorType($genType)
|
||||
{
|
||||
$this->_mockIdGeneratorType = $genType;
|
||||
}
|
||||
|
||||
public function update($entity)
|
||||
{
|
||||
$this->_updates[] = $entity;
|
||||
}
|
||||
|
||||
public function exists($entity, array $extraConditions = array())
|
||||
{
|
||||
$this->existsCalled = true;
|
||||
}
|
||||
|
||||
public function delete($entity)
|
||||
{
|
||||
$this->_deletes[] = $entity;
|
||||
}
|
||||
|
||||
public function getInserts()
|
||||
{
|
||||
return $this->_inserts;
|
||||
}
|
||||
|
||||
public function getUpdates()
|
||||
{
|
||||
return $this->_updates;
|
||||
}
|
||||
|
||||
public function getDeletes()
|
||||
{
|
||||
return $this->_deletes;
|
||||
}
|
||||
|
||||
public function reset()
|
||||
{
|
||||
$this->existsCalled = false;
|
||||
$this->_identityColumnValueCounter = 0;
|
||||
$this->_inserts = array();
|
||||
$this->_updates = array();
|
||||
$this->_deletes = array();
|
||||
}
|
||||
|
||||
public function isExistsCalled()
|
||||
{
|
||||
return $this->existsCalled;
|
||||
}
|
||||
}
|
111
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php
vendored
Normal file
111
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
/**
|
||||
* This class is a mock of the Statement interface that can be passed in to the Hydrator
|
||||
* to test the hydration standalone with faked result sets.
|
||||
*
|
||||
* @author Roman Borschel <roman@code-factory.org>
|
||||
*/
|
||||
class HydratorMockStatement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
|
||||
{
|
||||
private $_resultSet;
|
||||
|
||||
/**
|
||||
* Creates a new mock statement that will serve the provided fake result set to clients.
|
||||
*
|
||||
* @param array $resultSet The faked SQL result set.
|
||||
*/
|
||||
public function __construct(array $resultSet)
|
||||
{
|
||||
$this->_resultSet = $resultSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches all rows from the result set.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fetchAll($fetchStyle = null, $columnIndex = null, array $ctorArgs = null)
|
||||
{
|
||||
return $this->_resultSet;
|
||||
}
|
||||
|
||||
public function fetchColumn($columnNumber = 0)
|
||||
{
|
||||
$row = current($this->_resultSet);
|
||||
if ( ! is_array($row)) return false;
|
||||
$val = array_shift($row);
|
||||
return $val !== null ? $val : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the next row in the result set.
|
||||
*
|
||||
*/
|
||||
public function fetch($fetchStyle = null)
|
||||
{
|
||||
$current = current($this->_resultSet);
|
||||
next($this->_resultSet);
|
||||
return $current;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the cursor, enabling the statement to be executed again.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function closeCursor()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function setResultSet(array $resultSet)
|
||||
{
|
||||
reset($resultSet);
|
||||
$this->_resultSet = $resultSet;
|
||||
}
|
||||
|
||||
public function bindColumn($column, &$param, $type = null)
|
||||
{
|
||||
}
|
||||
|
||||
public function bindValue($param, $value, $type = null)
|
||||
{
|
||||
}
|
||||
|
||||
public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array())
|
||||
{
|
||||
}
|
||||
|
||||
public function columnCount()
|
||||
{
|
||||
}
|
||||
|
||||
public function errorCode()
|
||||
{
|
||||
}
|
||||
|
||||
public function errorInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public function execute($params = array())
|
||||
{
|
||||
}
|
||||
|
||||
public function rowCount()
|
||||
{
|
||||
}
|
||||
|
||||
public function getIterator()
|
||||
{
|
||||
return $this->_resultSet;
|
||||
}
|
||||
|
||||
public function setFetchMode($fetchMode)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
12
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php
vendored
Normal file
12
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/IdentityIdGeneratorMock.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
class IdentityIdGeneratorMock extends \Doctrine\ORM\Id\IdentityGenerator
|
||||
{
|
||||
private $_mockPostInsertId;
|
||||
|
||||
public function setMockPostInsertId($id) {
|
||||
$this->_mockPostInsertId = $id;
|
||||
}
|
||||
}
|
21
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php
vendored
Normal file
21
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
class MetadataDriverMock implements \Doctrine\ORM\Mapping\Driver\Driver
|
||||
{
|
||||
public function loadMetadataForClass($className, \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public function isTransient($className)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getAllClassNames()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
17
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MockTreeWalker.php
vendored
Normal file
17
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/MockTreeWalker.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
class MockTreeWalker extends \Doctrine\ORM\Query\TreeWalkerAdapter
|
||||
{
|
||||
/**
|
||||
* Gets an executor that can be used to execute the result of this walker.
|
||||
*
|
||||
* @return AbstractExecutor
|
||||
*/
|
||||
public function getExecutor($AST)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
13
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php
vendored
Normal file
13
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/SchemaManagerMock.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
class SchemaManagerMock extends \Doctrine\DBAL\Schema\AbstractSchemaManager
|
||||
{
|
||||
public function __construct(\Doctrine\DBAL\Connection $conn)
|
||||
{
|
||||
parent::__construct($conn);
|
||||
}
|
||||
|
||||
protected function _getPortableTableColumnDefinition($tableColumn) {}
|
||||
}
|
52
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/SequenceMock.php
vendored
Normal file
52
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/SequenceMock.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\ORM\EntityManager;
|
||||
|
||||
class SequenceMock extends \Doctrine\ORM\Id\SequenceGenerator
|
||||
{
|
||||
private $_sequenceNumber = 0;
|
||||
|
||||
public function generate(EntityManager $em, $entity)
|
||||
{
|
||||
return $this->_sequenceNumber++;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function nextId($seqName, $ondemand = true)
|
||||
{
|
||||
return $this->_sequenceNumber++;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function lastInsertId($table = null, $field = null)
|
||||
{
|
||||
return $this->_sequenceNumber - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function currId($seqName)
|
||||
{
|
||||
return $this->_sequenceNumber;
|
||||
}
|
||||
|
||||
/* Mock API */
|
||||
|
||||
public function reset()
|
||||
{
|
||||
$this->_sequenceNumber = 0;
|
||||
}
|
||||
|
||||
public function autoinc()
|
||||
{
|
||||
$this->_sequenceNumber++;
|
||||
}
|
||||
}
|
||||
|
81
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/TaskMock.php
vendored
Normal file
81
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/TaskMock.php
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
<?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\Tests\Mocks;
|
||||
|
||||
use Doctrine\Common\Cli\AbstractNamespace;
|
||||
|
||||
/**
|
||||
* TaskMock used for testing the CLI interface.
|
||||
* @author Nils Adermann <naderman@naderman.de>
|
||||
*/
|
||||
class TaskMock extends \Doctrine\Common\Cli\Tasks\AbstractTask
|
||||
{
|
||||
/**
|
||||
* Since instances of this class can be created elsewhere all instances
|
||||
* register themselves in this array for later inspection.
|
||||
*
|
||||
* @var array(TaskMock)
|
||||
*/
|
||||
static public $instances = array();
|
||||
|
||||
private $runCounter = 0;
|
||||
|
||||
/**
|
||||
* Constructor of Task Mock Object.
|
||||
* Makes sure the object can be inspected later.
|
||||
*
|
||||
* @param AbstractNamespace CLI Namespace, passed to parent constructor
|
||||
*/
|
||||
function __construct(AbstractNamespace $namespace)
|
||||
{
|
||||
self::$instances[] = $this;
|
||||
|
||||
parent::__construct($namespace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of times run() was called on this object.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRunCounter()
|
||||
{
|
||||
return $this->runCounter;
|
||||
}
|
||||
|
||||
/* Mock API */
|
||||
|
||||
/**
|
||||
* Method invoked by CLI to run task.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->runCounter++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method supposed to generate the CLI Task Documentation
|
||||
*/
|
||||
public function buildDocumentation()
|
||||
{
|
||||
}
|
||||
}
|
58
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php
vendored
Normal file
58
vendor/doctrine/orm/tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
class UnitOfWorkMock extends \Doctrine\ORM\UnitOfWork
|
||||
{
|
||||
private $_mockDataChangeSets = array();
|
||||
private $_persisterMock;
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
public function getEntityPersister($entityName)
|
||||
{
|
||||
return isset($this->_persisterMock[$entityName]) ?
|
||||
$this->_persisterMock[$entityName] : parent::getEntityPersister($entityName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param <type> $entity
|
||||
* @override
|
||||
*/
|
||||
public function getEntityChangeSet($entity)
|
||||
{
|
||||
$oid = spl_object_hash($entity);
|
||||
return isset($this->_mockDataChangeSets[$oid]) ?
|
||||
$this->_mockDataChangeSets[$oid] : parent::getEntityChangeSet($entity);
|
||||
}
|
||||
|
||||
/* MOCK API */
|
||||
|
||||
/**
|
||||
* Sets a (mock) persister for an entity class that will be returned when
|
||||
* getEntityPersister() is invoked for that class.
|
||||
*
|
||||
* @param <type> $entityName
|
||||
* @param <type> $persister
|
||||
*/
|
||||
public function setEntityPersister($entityName, $persister)
|
||||
{
|
||||
$this->_persisterMock[$entityName] = $persister;
|
||||
}
|
||||
|
||||
public function setDataChangeSet($entity, array $mockChangeSet)
|
||||
{
|
||||
$this->_mockDataChangeSets[spl_object_hash($entity)] = $mockChangeSet;
|
||||
}
|
||||
|
||||
public function setEntityState($entity, $state)
|
||||
{
|
||||
$this->_entityStates[spl_object_hash($entity)] = $state;
|
||||
}
|
||||
|
||||
public function setOriginalEntityData($entity, array $originalData)
|
||||
{
|
||||
$this->_originalEntityData[spl_object_hash($entity)] = $originalData;
|
||||
}
|
||||
}
|
72
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php
vendored
Normal file
72
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\CMS;
|
||||
|
||||
/**
|
||||
* CmsAddress
|
||||
*
|
||||
* @author Roman S. Borschel
|
||||
* @Entity
|
||||
* @Table(name="cms_addresses")
|
||||
*/
|
||||
class CmsAddress
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
* @Id @GeneratedValue
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @Column(length=50)
|
||||
*/
|
||||
public $country;
|
||||
|
||||
/**
|
||||
* @Column(length=50)
|
||||
*/
|
||||
public $zip;
|
||||
|
||||
/**
|
||||
* @Column(length=50)
|
||||
*/
|
||||
public $city;
|
||||
|
||||
/**
|
||||
* Testfield for Schema Updating Tests.
|
||||
*/
|
||||
public $street;
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="CmsUser", inversedBy="address")
|
||||
* @JoinColumn(referencedColumnName="id")
|
||||
*/
|
||||
public $user;
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getUser() {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function getCountry() {
|
||||
return $this->country;
|
||||
}
|
||||
|
||||
public function getZipCode() {
|
||||
return $this->zip;
|
||||
}
|
||||
|
||||
public function getCity() {
|
||||
return $this->city;
|
||||
}
|
||||
|
||||
public function setUser(CmsUser $user) {
|
||||
if ($this->user !== $user) {
|
||||
$this->user = $user;
|
||||
$user->setAddress($this);
|
||||
}
|
||||
}
|
||||
}
|
48
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsArticle.php
vendored
Normal file
48
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsArticle.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\CMS;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="cms_articles")
|
||||
*/
|
||||
class CmsArticle
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(type="string", length=255)
|
||||
*/
|
||||
public $topic;
|
||||
/**
|
||||
* @Column(type="text")
|
||||
*/
|
||||
public $text;
|
||||
/**
|
||||
* @ManyToOne(targetEntity="CmsUser", inversedBy="articles")
|
||||
* @JoinColumn(name="user_id", referencedColumnName="id")
|
||||
*/
|
||||
public $user;
|
||||
/**
|
||||
* @OneToMany(targetEntity="CmsComment", mappedBy="article")
|
||||
*/
|
||||
public $comments;
|
||||
|
||||
/**
|
||||
* @Version @column(type="integer")
|
||||
*/
|
||||
public $version;
|
||||
|
||||
public function setAuthor(CmsUser $author) {
|
||||
$this->user = $author;
|
||||
}
|
||||
|
||||
public function addComment(CmsComment $comment) {
|
||||
$this->comments[] = $comment;
|
||||
$comment->setArticle($this);
|
||||
}
|
||||
}
|
38
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsComment.php
vendored
Normal file
38
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsComment.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\CMS;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="cms_comments")
|
||||
*/
|
||||
class CmsComment
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
* @Id
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(type="string", length=255)
|
||||
*/
|
||||
public $topic;
|
||||
/**
|
||||
* @Column(type="string")
|
||||
*/
|
||||
public $text;
|
||||
/**
|
||||
* @ManyToOne(targetEntity="CmsArticle", inversedBy="comments")
|
||||
* @JoinColumn(name="article_id", referencedColumnName="id")
|
||||
*/
|
||||
public $article;
|
||||
|
||||
public function setArticle(CmsArticle $article) {
|
||||
$this->article = $article;
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
return __CLASS__."[id=".$this->id."]";
|
||||
}
|
||||
}
|
48
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmail.php
vendored
Normal file
48
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmail.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\CMS;
|
||||
|
||||
/**
|
||||
* CmsEmail
|
||||
*
|
||||
* @Entity
|
||||
* @Table(name="cms_emails")
|
||||
*/
|
||||
class CmsEmail
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
* @Id @GeneratedValue
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @Column(length=250)
|
||||
*/
|
||||
public $email;
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="CmsUser", mappedBy="email")
|
||||
*/
|
||||
public $user;
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getEmail() {
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail($email) {
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
public function getUser() {
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function setUser(CmsUser $user) {
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
44
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php
vendored
Normal file
44
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsEmployee.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\CMS;
|
||||
|
||||
/**
|
||||
* Description of CmsEmployee
|
||||
*
|
||||
* @author robo
|
||||
* @Entity
|
||||
* @Table(name="cms_employees")
|
||||
*/
|
||||
class CmsEmployee
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @Column
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="CmsEmployee")
|
||||
* @JoinColumn(name="spouse_id", referencedColumnName="id")
|
||||
*/
|
||||
private $spouse;
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getSpouse() {
|
||||
return $this->spouse;
|
||||
}
|
||||
}
|
||||
|
49
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsGroup.php
vendored
Normal file
49
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsGroup.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
namespace Doctrine\Tests\Models\CMS;
|
||||
|
||||
/**
|
||||
* Description of CmsGroup
|
||||
*
|
||||
* @author robo
|
||||
* @Entity
|
||||
* @Table(name="cms_groups")
|
||||
*/
|
||||
class CmsGroup
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(length=50)
|
||||
*/
|
||||
public $name;
|
||||
/**
|
||||
* @ManyToMany(targetEntity="CmsUser", mappedBy="groups")
|
||||
*/
|
||||
public $users;
|
||||
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function addUser(CmsUser $user) {
|
||||
$this->users[] = $user;
|
||||
}
|
||||
|
||||
public function getUsers() {
|
||||
return $this->users;
|
||||
}
|
||||
}
|
||||
|
28
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php
vendored
Normal file
28
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsPhonenumber.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\CMS;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="cms_phonenumbers")
|
||||
*/
|
||||
class CmsPhonenumber
|
||||
{
|
||||
/**
|
||||
* @Id @Column(length=50)
|
||||
*/
|
||||
public $phonenumber;
|
||||
/**
|
||||
* @ManyToOne(targetEntity="CmsUser", inversedBy="phonenumbers", cascade={"merge"})
|
||||
* @JoinColumn(name="user_id", referencedColumnName="id")
|
||||
*/
|
||||
public $user;
|
||||
|
||||
public function setUser(CmsUser $user) {
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
public function getUser() {
|
||||
return $this->user;
|
||||
}
|
||||
}
|
139
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsUser.php
vendored
Normal file
139
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsUser.php
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\CMS;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="cms_users")
|
||||
* @NamedQueries({
|
||||
* @NamedQuery(name="all", query="SELECT u FROM __CLASS__ u")
|
||||
* })
|
||||
*/
|
||||
class CmsUser
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(type="string", length=50, nullable=true)
|
||||
*/
|
||||
public $status;
|
||||
/**
|
||||
* @Column(type="string", length=255, unique=true)
|
||||
*/
|
||||
public $username;
|
||||
/**
|
||||
* @Column(type="string", length=255)
|
||||
*/
|
||||
public $name;
|
||||
/**
|
||||
* @OneToMany(targetEntity="CmsPhonenumber", mappedBy="user", cascade={"persist", "merge"}, orphanRemoval=true)
|
||||
*/
|
||||
public $phonenumbers;
|
||||
/**
|
||||
* @OneToMany(targetEntity="CmsArticle", mappedBy="user", cascade={"detach"})
|
||||
*/
|
||||
public $articles;
|
||||
/**
|
||||
* @OneToOne(targetEntity="CmsAddress", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
|
||||
*/
|
||||
public $address;
|
||||
/**
|
||||
* @OneToOne(targetEntity="CmsEmail", inversedBy="user", cascade={"persist"}, orphanRemoval=true)
|
||||
* @JoinColumn(referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
public $email;
|
||||
/**
|
||||
* @ManyToMany(targetEntity="CmsGroup", inversedBy="users", cascade={"persist", "merge", "detach"})
|
||||
* @JoinTable(name="cms_users_groups",
|
||||
* joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@JoinColumn(name="group_id", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
public $groups;
|
||||
|
||||
public function __construct() {
|
||||
$this->phonenumbers = new ArrayCollection;
|
||||
$this->articles = new ArrayCollection;
|
||||
$this->groups = new ArrayCollection;
|
||||
}
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getStatus() {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function getUsername() {
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a phonenumber to the user.
|
||||
*
|
||||
* @param CmsPhonenumber $phone
|
||||
*/
|
||||
public function addPhonenumber(CmsPhonenumber $phone) {
|
||||
$this->phonenumbers[] = $phone;
|
||||
$phone->setUser($this);
|
||||
}
|
||||
|
||||
public function getPhonenumbers() {
|
||||
return $this->phonenumbers;
|
||||
}
|
||||
|
||||
public function addArticle(CmsArticle $article) {
|
||||
$this->articles[] = $article;
|
||||
$article->setAuthor($this);
|
||||
}
|
||||
|
||||
public function addGroup(CmsGroup $group) {
|
||||
$this->groups[] = $group;
|
||||
$group->addUser($this);
|
||||
}
|
||||
|
||||
public function getGroups() {
|
||||
return $this->groups;
|
||||
}
|
||||
|
||||
public function removePhonenumber($index) {
|
||||
if (isset($this->phonenumbers[$index])) {
|
||||
$ph = $this->phonenumbers[$index];
|
||||
unset($this->phonenumbers[$index]);
|
||||
$ph->user = null;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getAddress() { return $this->address; }
|
||||
|
||||
public function setAddress(CmsAddress $address) {
|
||||
if ($this->address !== $address) {
|
||||
$this->address = $address;
|
||||
$address->setUser($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function getEmail() { return $this->email; }
|
||||
|
||||
public function setEmail(CmsEmail $email = null) {
|
||||
if ($this->email !== $email) {
|
||||
$this->email = $email;
|
||||
|
||||
if ($email) {
|
||||
$email->setUser($this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
17
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyAuction.php
vendored
Normal file
17
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyAuction.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/** @Entity @Table(name="company_auctions") */
|
||||
class CompanyAuction extends CompanyEvent {
|
||||
/** @Column(type="string") */
|
||||
private $data;
|
||||
|
||||
public function setData($data) {
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function getData() {
|
||||
return $this->data;
|
||||
}
|
||||
}
|
33
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyCar.php
vendored
Normal file
33
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyCar.php
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="company_cars")
|
||||
*/
|
||||
class CompanyCar
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @Column(type="string", length=50)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
public function __construct($brand = null) {
|
||||
$this->brand = $brand;
|
||||
}
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getBrand() {
|
||||
return $this->title;
|
||||
}
|
||||
}
|
89
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyContract.php
vendored
Normal file
89
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyContract.php
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="company_contracts")
|
||||
* @InheritanceType("SINGLE_TABLE")
|
||||
* @DiscriminatorColumn(name="discr", type="string")
|
||||
* @DiscriminatorMap({
|
||||
* "fix" = "CompanyFixContract",
|
||||
* "flexible" = "CompanyFlexContract",
|
||||
* "flexultra" = "CompanyFlexUltraContract"
|
||||
* })
|
||||
*/
|
||||
abstract class CompanyContract
|
||||
{
|
||||
/**
|
||||
* @Id @column(type="integer") @GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="CompanyEmployee", inversedBy="soldContracts")
|
||||
*/
|
||||
private $salesPerson;
|
||||
|
||||
/**
|
||||
* @Column(type="boolean")
|
||||
* @var bool
|
||||
*/
|
||||
private $completed = false;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="CompanyEmployee", inversedBy="contracts")
|
||||
* @JoinTable(name="company_contract_employees",
|
||||
* joinColumns={@JoinColumn(name="contract_id", referencedColumnName="id", onDelete="CASCADE")},
|
||||
* inverseJoinColumns={@JoinColumn(name="employee_id", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
private $engineers;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->engineers = new \Doctrine\Common\Collections\ArrayCollection;
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function markCompleted()
|
||||
{
|
||||
$this->completed = true;
|
||||
}
|
||||
|
||||
public function isCompleted()
|
||||
{
|
||||
return $this->completed;
|
||||
}
|
||||
|
||||
public function getSalesPerson()
|
||||
{
|
||||
return $this->salesPerson;
|
||||
}
|
||||
|
||||
public function setSalesPerson(CompanyEmployee $salesPerson)
|
||||
{
|
||||
$this->salesPerson = $salesPerson;
|
||||
}
|
||||
|
||||
public function getEngineers()
|
||||
{
|
||||
return $this->engineers;
|
||||
}
|
||||
|
||||
public function addEngineer(CompanyEmployee $engineer)
|
||||
{
|
||||
$this->engineers[] = $engineer;
|
||||
}
|
||||
|
||||
public function removeEngineer(CompanyEmployee $engineer)
|
||||
{
|
||||
$this->engineers->removeElement($engineer);
|
||||
}
|
||||
|
||||
abstract public function calculatePrice();
|
||||
}
|
59
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEmployee.php
vendored
Normal file
59
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEmployee.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="company_employees")
|
||||
*/
|
||||
class CompanyEmployee extends CompanyPerson
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
*/
|
||||
private $salary;
|
||||
|
||||
/**
|
||||
* @Column(type="string", length=255)
|
||||
*/
|
||||
private $department;
|
||||
|
||||
/**
|
||||
* @Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private $startDate;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="CompanyContract", mappedBy="engineers", fetch="EXTRA_LAZY")
|
||||
*/
|
||||
public $contracts;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="CompanyFlexUltraContract", mappedBy="salesPerson", fetch="EXTRA_LAZY")
|
||||
*/
|
||||
public $soldContracts;
|
||||
|
||||
public function getSalary() {
|
||||
return $this->salary;
|
||||
}
|
||||
|
||||
public function setSalary($salary) {
|
||||
$this->salary = $salary;
|
||||
}
|
||||
|
||||
public function getDepartment() {
|
||||
return $this->department;
|
||||
}
|
||||
|
||||
public function setDepartment($dep) {
|
||||
$this->department = $dep;
|
||||
}
|
||||
|
||||
public function getStartDate() {
|
||||
return $this->startDate;
|
||||
}
|
||||
|
||||
public function setStartDate($date) {
|
||||
$this->startDate = $date;
|
||||
}
|
||||
}
|
36
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEvent.php
vendored
Normal file
36
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyEvent.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/**
|
||||
* @Entity @Table(name="company_events")
|
||||
* @InheritanceType("JOINED")
|
||||
* @DiscriminatorColumn(name="event_type", type="string")
|
||||
* @DiscriminatorMap({"auction"="CompanyAuction", "raffle"="CompanyRaffle"})
|
||||
*/
|
||||
abstract class CompanyEvent {
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="CompanyOrganization", inversedBy="events", cascade={"persist"})
|
||||
* @JoinColumn(name="org_id", referencedColumnName="id")
|
||||
*/
|
||||
private $organization;
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getOrganization() {
|
||||
return $this->organization;
|
||||
}
|
||||
|
||||
public function setOrganization(CompanyOrganization $org) {
|
||||
$this->organization = $org;
|
||||
}
|
||||
|
||||
}
|
30
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php
vendored
Normal file
30
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFixContract.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class CompanyFixContract extends CompanyContract
|
||||
{
|
||||
/**
|
||||
* @column(type="integer")
|
||||
* @var int
|
||||
*/
|
||||
private $fixPrice = 0;
|
||||
|
||||
public function calculatePrice()
|
||||
{
|
||||
return $this->fixPrice;
|
||||
}
|
||||
|
||||
public function getFixPrice()
|
||||
{
|
||||
return $this->fixPrice;
|
||||
}
|
||||
|
||||
public function setFixPrice($fixPrice)
|
||||
{
|
||||
$this->fixPrice = $fixPrice;
|
||||
}
|
||||
}
|
68
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php
vendored
Normal file
68
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class CompanyFlexContract extends CompanyContract
|
||||
{
|
||||
/**
|
||||
* @column(type="integer")
|
||||
* @var int
|
||||
*/
|
||||
private $hoursWorked = 0;
|
||||
|
||||
/**
|
||||
* @column(type="integer")
|
||||
* @var int
|
||||
*/
|
||||
private $pricePerHour = 0;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="CompanyManager", inversedBy="managedContracts", fetch="EXTRA_LAZY")
|
||||
* @JoinTable(name="company_contract_managers",
|
||||
* joinColumns={@JoinColumn(name="contract_id", referencedColumnName="id", onDelete="CASCADE")},
|
||||
* inverseJoinColumns={@JoinColumn(name="employee_id", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
public $managers;
|
||||
|
||||
public function calculatePrice()
|
||||
{
|
||||
return $this->hoursWorked * $this->pricePerHour;
|
||||
}
|
||||
|
||||
public function getHoursWorked()
|
||||
{
|
||||
return $this->hoursWorked;
|
||||
}
|
||||
|
||||
public function setHoursWorked($hoursWorked)
|
||||
{
|
||||
$this->hoursWorked = $hoursWorked;
|
||||
}
|
||||
|
||||
public function getPricePerHour()
|
||||
{
|
||||
return $this->pricePerHour;
|
||||
}
|
||||
|
||||
public function setPricePerHour($pricePerHour)
|
||||
{
|
||||
$this->pricePerHour = $pricePerHour;
|
||||
}
|
||||
public function getManagers()
|
||||
{
|
||||
return $this->managers;
|
||||
}
|
||||
|
||||
public function addManager(CompanyManager $manager)
|
||||
{
|
||||
$this->managers[] = $manager;
|
||||
}
|
||||
|
||||
public function removeManager(CompanyManager $manager)
|
||||
{
|
||||
$this->managers->removeElement($manager);
|
||||
}
|
||||
}
|
30
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php
vendored
Normal file
30
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyFlexUltraContract.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class CompanyFlexUltraContract extends CompanyFlexContract
|
||||
{
|
||||
/**
|
||||
* @column(type="integer")
|
||||
* @var int
|
||||
*/
|
||||
private $maxPrice = 0;
|
||||
|
||||
public function calculatePrice()
|
||||
{
|
||||
return max($this->maxPrice, parent::calculatePrice());
|
||||
}
|
||||
|
||||
public function getMaxPrice()
|
||||
{
|
||||
return $this->maxPrice;
|
||||
}
|
||||
|
||||
public function setMaxPrice($maxPrice)
|
||||
{
|
||||
$this->maxPrice = $maxPrice;
|
||||
}
|
||||
}
|
42
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyManager.php
vendored
Normal file
42
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyManager.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="company_managers")
|
||||
*/
|
||||
class CompanyManager extends CompanyEmployee
|
||||
{
|
||||
/**
|
||||
* @Column(type="string", length=250)
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="CompanyCar", cascade={"persist"})
|
||||
* @JoinColumn(name="car_id", referencedColumnName="id")
|
||||
*/
|
||||
private $car;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="CompanyFlexContract", mappedBy="managers", fetch="EXTRA_LAZY")
|
||||
*/
|
||||
public $managedContracts;
|
||||
|
||||
public function getTitle() {
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function setTitle($title) {
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
public function getCar() {
|
||||
return $this->car;
|
||||
}
|
||||
|
||||
public function setCar(CompanyCar $car) {
|
||||
$this->car = $car;
|
||||
}
|
||||
}
|
44
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyOrganization.php
vendored
Normal file
44
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyOrganization.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/** @Entity @Table(name="company_organizations") */
|
||||
class CompanyOrganization {
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="CompanyEvent", mappedBy="organization", cascade={"persist"}, fetch="EXTRA_LAZY")
|
||||
*/
|
||||
public $events;
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getEvents() {
|
||||
return $this->events;
|
||||
}
|
||||
|
||||
public function addEvent(CompanyEvent $event) {
|
||||
$this->events[] = $event;
|
||||
$event->setOrganization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="CompanyEvent", cascade={"persist"})
|
||||
* @JoinColumn(name="main_event_id", referencedColumnName="id", nullable=true)
|
||||
*/
|
||||
private $mainevent;
|
||||
|
||||
public function getMainEvent() {
|
||||
return $this->mainevent;
|
||||
}
|
||||
|
||||
public function setMainEvent($event) {
|
||||
$this->mainevent = $event;
|
||||
}
|
||||
}
|
82
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyPerson.php
vendored
Normal file
82
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyPerson.php
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/**
|
||||
* Description of CompanyPerson
|
||||
*
|
||||
* @author robo
|
||||
* @Entity
|
||||
* @Table(name="company_persons")
|
||||
* @InheritanceType("JOINED")
|
||||
* @DiscriminatorColumn(name="discr", type="string")
|
||||
* @DiscriminatorMap({
|
||||
* "person" = "CompanyPerson",
|
||||
* "manager" = "CompanyManager",
|
||||
* "employee" = "CompanyEmployee"})
|
||||
*/
|
||||
class CompanyPerson
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
/**
|
||||
* @Column
|
||||
*/
|
||||
private $name;
|
||||
/**
|
||||
* @OneToOne(targetEntity="CompanyPerson")
|
||||
* @JoinColumn(name="spouse_id", referencedColumnName="id")
|
||||
*/
|
||||
private $spouse;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="CompanyPerson")
|
||||
* @JoinTable(name="company_persons_friends",
|
||||
joinColumns={@JoinColumn(name="person_id", referencedColumnName="id")},
|
||||
inverseJoinColumns={@JoinColumn(name="friend_id", referencedColumnName="id")})
|
||||
*/
|
||||
private $friends;
|
||||
|
||||
public function __construct() {
|
||||
$this->friends = new \Doctrine\Common\Collections\ArrayCollection;
|
||||
}
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function getSpouse() {
|
||||
return $this->spouse;
|
||||
}
|
||||
|
||||
public function getFriends() {
|
||||
return $this->friends;
|
||||
}
|
||||
|
||||
public function addFriend(CompanyPerson $friend) {
|
||||
if ( ! $this->friends->contains($friend)) {
|
||||
$this->friends->add($friend);
|
||||
$friend->addFriend($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function setSpouse(CompanyPerson $spouse) {
|
||||
if ($spouse !== $this->spouse) {
|
||||
$this->spouse = $spouse;
|
||||
$this->spouse->setSpouse($this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
17
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php
vendored
Normal file
17
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
/** @Entity @Table(name="company_raffles") */
|
||||
class CompanyRaffle extends CompanyEvent {
|
||||
/** @Column */
|
||||
private $data;
|
||||
|
||||
public function setData($data) {
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
public function getData() {
|
||||
return $this->data;
|
||||
}
|
||||
}
|
21
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeChild.php
vendored
Normal file
21
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeChild.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\CustomType;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="customtype_children")
|
||||
*/
|
||||
class CustomTypeChild
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @Column(type="upper_case_string")
|
||||
*/
|
||||
public $lowerCaseString = 'foo';
|
||||
}
|
68
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeParent.php
vendored
Normal file
68
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeParent.php
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\CustomType;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="customtype_parents")
|
||||
*/
|
||||
class CustomTypeParent
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @Column(type="negative_to_positive", nullable=true)
|
||||
*/
|
||||
public $customInteger;
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeChild", cascade={"persist", "remove"})
|
||||
*/
|
||||
public $child;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeParent", mappedBy="myFriends")
|
||||
*/
|
||||
private $friendsWithMe;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeParent", inversedBy="friendsWithMe")
|
||||
* @JoinTable(
|
||||
* name="customtype_parent_friends",
|
||||
* joinColumns={@JoinColumn(name="customtypeparent_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@JoinColumn(name="friend_customtypeparent_id", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
private $myFriends;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->friendsWithMe = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->myFriends = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
public function addMyFriend(CustomTypeParent $friend)
|
||||
{
|
||||
$this->getMyFriends()->add($friend);
|
||||
$friend->addFriendWithMe($this);
|
||||
}
|
||||
|
||||
public function getMyFriends()
|
||||
{
|
||||
return $this->myFriends;
|
||||
}
|
||||
|
||||
public function addFriendWithMe(CustomTypeParent $friend)
|
||||
{
|
||||
$this->getFriendsWithMe()->add($friend);
|
||||
}
|
||||
|
||||
public function getFriendsWithMe()
|
||||
{
|
||||
return $this->friendsWithMe;
|
||||
}
|
||||
}
|
21
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeUpperCase.php
vendored
Normal file
21
vendor/doctrine/orm/tests/Doctrine/Tests/Models/CustomType/CustomTypeUpperCase.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\CustomType;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="customtype_uppercases")
|
||||
*/
|
||||
class CustomTypeUpperCase
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @Column(type="upper_case_string")
|
||||
*/
|
||||
public $lowerCaseString;
|
||||
}
|
65
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php
vendored
Normal file
65
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC117;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class DDC117ApproveChanges
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer") @GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="DDC117ArticleDetails")
|
||||
* @JoinColumn(name="details_id", referencedColumnName="article_id")
|
||||
*/
|
||||
private $articleDetails;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="DDC117Reference")
|
||||
* @JoinColumns({
|
||||
* @JoinColumn(name="source_id", referencedColumnName="source_id"),
|
||||
* @JoinColumn(name="target_id", referencedColumnName="target_id")
|
||||
* })
|
||||
*/
|
||||
private $reference;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="DDC117Translation")
|
||||
* @JoinColumns({
|
||||
* @JoinColumn(name="trans_article_id", referencedColumnName="article_id"),
|
||||
* @JoinColumn(name="trans_language", referencedColumnName="language")
|
||||
* })
|
||||
*/
|
||||
private $translation;
|
||||
|
||||
public function __construct($details, $reference, $translation)
|
||||
{
|
||||
$this->articleDetails = $details;
|
||||
$this->reference = $reference;
|
||||
$this->translation = $translation;
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getArticleDetails()
|
||||
{
|
||||
return $this->articleDetails;
|
||||
}
|
||||
|
||||
public function getReference()
|
||||
{
|
||||
return $this->reference;
|
||||
}
|
||||
|
||||
public function getTranslation()
|
||||
{
|
||||
return $this->translation;
|
||||
}
|
||||
}
|
87
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Article.php
vendored
Normal file
87
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Article.php
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC117;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class DDC117Article
|
||||
{
|
||||
/** @Id @Column(type="integer", name="article_id") @GeneratedValue */
|
||||
private $id;
|
||||
|
||||
/** @Column */
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="DDC117Reference", mappedBy="source", cascade={"remove"})
|
||||
*/
|
||||
private $references;
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="DDC117ArticleDetails", mappedBy="article", cascade={"persist", "remove"})
|
||||
*/
|
||||
private $details;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="DDC117Translation", mappedBy="article", cascade={"persist", "remove"})
|
||||
*/
|
||||
private $translations;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="DDC117Link", mappedBy="source")
|
||||
*/
|
||||
private $links;
|
||||
|
||||
public function __construct($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
$this->references = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->translations = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
public function setDetails($details)
|
||||
{
|
||||
$this->details = $details;
|
||||
}
|
||||
|
||||
public function id()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function addReference($reference)
|
||||
{
|
||||
$this->references[] = $reference;
|
||||
}
|
||||
|
||||
public function references()
|
||||
{
|
||||
return $this->references;
|
||||
}
|
||||
|
||||
public function addTranslation($language, $title)
|
||||
{
|
||||
$this->translations[] = new DDC117Translation($this, $language, $title);
|
||||
}
|
||||
|
||||
public function getText()
|
||||
{
|
||||
return $this->details->getText();
|
||||
}
|
||||
|
||||
public function getDetails()
|
||||
{
|
||||
return $this->details;
|
||||
}
|
||||
|
||||
public function resetText()
|
||||
{
|
||||
$this->details = null;
|
||||
}
|
||||
|
||||
public function getTranslations()
|
||||
{
|
||||
return $this->translations;
|
||||
}
|
||||
}
|
39
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php
vendored
Normal file
39
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC117;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class DDC117ArticleDetails
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @OneToOne(targetEntity="DDC117Article", inversedBy="details")
|
||||
* @JoinColumn(name="article_id", referencedColumnName="article_id")
|
||||
*/
|
||||
private $article;
|
||||
|
||||
/**
|
||||
* @Column(type="text")
|
||||
*/
|
||||
private $text;
|
||||
|
||||
public function __construct($article, $text)
|
||||
{
|
||||
$this->article = $article;
|
||||
$article->setDetails($this);
|
||||
|
||||
$this->update($text);
|
||||
}
|
||||
|
||||
public function update($text)
|
||||
{
|
||||
$this->text = $text;
|
||||
}
|
||||
|
||||
public function getText()
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
}
|
54
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php
vendored
Normal file
54
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC117;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class DDC117Editor
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer") @GeneratedValue
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @Column(type="string")
|
||||
*/
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="DDC117Translation", inversedBy="reviewedByEditors")
|
||||
* @JoinTable(
|
||||
* inverseJoinColumns={
|
||||
* @JoinColumn(name="article_id", referencedColumnName="article_id"),
|
||||
* @JoinColumn(name="language", referencedColumnName="language")
|
||||
* },
|
||||
* joinColumns={
|
||||
* @JoinColumn(name="editor_id", referencedColumnName="id")
|
||||
* }
|
||||
* )
|
||||
*/
|
||||
public $reviewingTranslations;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="DDC117Translation", inversedBy="lastTranslatedBy")
|
||||
* @JoinColumns({
|
||||
* @JoinColumn(name="lt_article_id", referencedColumnName="article_id"),
|
||||
* @JoinColumn(name="lt_language", referencedColumnName="language")
|
||||
* })
|
||||
*/
|
||||
public $lastTranslation;
|
||||
|
||||
public function __construct($name = "")
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->reviewingTranslations = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
public function addLastTranslation(DDC117Translation $t)
|
||||
{
|
||||
$this->lastTranslation = $t;
|
||||
$t->lastTranslatedBy[] = $this;
|
||||
}
|
||||
}
|
31
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Link.php
vendored
Normal file
31
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Link.php
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC117;
|
||||
|
||||
/**
|
||||
* Foreign Key Entity without additional fields!
|
||||
*
|
||||
* @Entity
|
||||
*/
|
||||
class DDC117Link
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @ManyToOne(targetEntity="DDC117Article", inversedBy="links")
|
||||
* @JoinColumn(name="source_id", referencedColumnName="article_id")
|
||||
*/
|
||||
public $source;
|
||||
|
||||
/**
|
||||
* @Id
|
||||
* @ManyToOne(targetEntity="DDC117Article")
|
||||
* @JoinColumn(name="target_id", referencedColumnName="article_id")
|
||||
*/
|
||||
public $target;
|
||||
|
||||
public function __construct($source, $target, $description)
|
||||
{
|
||||
$this->source = $source;
|
||||
$this->target = $target;
|
||||
}
|
||||
}
|
64
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Reference.php
vendored
Normal file
64
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Reference.php
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC117;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class DDC117Reference
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @ManyToOne(targetEntity="DDC117Article", inversedBy="references")
|
||||
* @JoinColumn(name="source_id", referencedColumnName="article_id")
|
||||
*/
|
||||
private $source;
|
||||
|
||||
/**
|
||||
* @Id
|
||||
* @ManyToOne(targetEntity="DDC117Article")
|
||||
* @JoinColumn(name="target_id", referencedColumnName="article_id")
|
||||
*/
|
||||
private $target;
|
||||
|
||||
/**
|
||||
* @column(type="string")
|
||||
*/
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* @column(type="datetime")
|
||||
*/
|
||||
private $created;
|
||||
|
||||
public function __construct($source, $target, $description)
|
||||
{
|
||||
$source->addReference($this);
|
||||
$target->addReference($this);
|
||||
|
||||
$this->source = $source;
|
||||
$this->target = $target;
|
||||
$this->description = $description;
|
||||
$this->created = new \DateTime("now");
|
||||
}
|
||||
|
||||
public function source()
|
||||
{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
public function target()
|
||||
{
|
||||
return $this->target;
|
||||
}
|
||||
|
||||
public function setDescription($desc)
|
||||
{
|
||||
$this->description = $desc;
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
}
|
65
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Translation.php
vendored
Normal file
65
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC117/DDC117Translation.php
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\DDC117;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class DDC117Translation
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @ManyToOne(targetEntity="DDC117Article", inversedBy="translations")
|
||||
* @JoinColumn(name="article_id", referencedColumnName="article_id")
|
||||
*/
|
||||
private $article;
|
||||
|
||||
/**
|
||||
* @Id @column(type="string")
|
||||
*/
|
||||
private $language;
|
||||
|
||||
/**
|
||||
* @column(type="string")
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="DDC117Editor", mappedBy="reviewingTranslations")
|
||||
*/
|
||||
public $reviewedByEditors;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="DDC117Editor", mappedBy="lastTranslation")
|
||||
*/
|
||||
public $lastTranslatedBy;
|
||||
|
||||
public function __construct($article, $language, $title)
|
||||
{
|
||||
$this->article = $article;
|
||||
$this->language = $language;
|
||||
$this->title = $title;
|
||||
$this->reviewedByEditors = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
$this->lastTranslatedBy = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
public function getArticleId()
|
||||
{
|
||||
return $this->article->id();
|
||||
}
|
||||
|
||||
public function getLanguage()
|
||||
{
|
||||
return $this->language;
|
||||
}
|
||||
|
||||
public function getLastTranslatedBy()
|
||||
{
|
||||
return $this->lastTranslatedBy;
|
||||
}
|
||||
|
||||
public function getReviewedByEditors()
|
||||
{
|
||||
return $this->reviewedByEditors;
|
||||
}
|
||||
}
|
76
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php
vendored
Normal file
76
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC1476/DDC1476EntityWithDefaultFieldType.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC1476;
|
||||
|
||||
/**
|
||||
* @Entity()
|
||||
*/
|
||||
class DDC1476EntityWithDefaultFieldType
|
||||
{
|
||||
|
||||
/**
|
||||
* @Id
|
||||
* @Column()
|
||||
* @GeneratedValue("NONE")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/** @column() */
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
|
||||
{
|
||||
$metadata->mapField(array(
|
||||
'id' => true,
|
||||
'fieldName' => 'id',
|
||||
));
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'name',
|
||||
));
|
||||
|
||||
$metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadataInfo::GENERATOR_TYPE_NONE);
|
||||
}
|
||||
|
||||
}
|
36
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753CustomRepository.php
vendored
Normal file
36
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753CustomRepository.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC753;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class DDC753CustomRepository extends EntityRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isCustomRepository()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
35
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753DefaultRepository.php
vendored
Normal file
35
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753DefaultRepository.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC753;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class DDC753DefaultRepository extends EntityRepository
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isDefaultRepository()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
39
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithCustomRepository.php
vendored
Normal file
39
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithCustomRepository.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC753;
|
||||
|
||||
/**
|
||||
* @Entity(repositoryClass = "Doctrine\Tests\Models\DDC753\DDC753CustomRepository")
|
||||
*/
|
||||
class DDC753EntityWithCustomRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/** @column(type="string") */
|
||||
protected $name;
|
||||
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC753;
|
||||
|
||||
/**
|
||||
* @Entity()
|
||||
*/
|
||||
class DDC753EntityWithDefaultCustomRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/** @column(type="string") */
|
||||
protected $name;
|
||||
|
||||
}
|
39
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithInvalidRepository.php
vendored
Normal file
39
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753EntityWithInvalidRepository.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC753;
|
||||
|
||||
/**
|
||||
* @Entity(repositoryClass = "\stdClass")
|
||||
*/
|
||||
class DDC753EntityWithInvalidRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/** @column(type="string") */
|
||||
protected $name;
|
||||
|
||||
}
|
28
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753InvalidRepository.php
vendored
Normal file
28
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC753/DDC753InvalidRepository.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC753;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class DDC753InvalidRepository
|
||||
{
|
||||
|
||||
}
|
40
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php
vendored
Normal file
40
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC869;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class DDC869ChequePayment extends DDC869Payment
|
||||
{
|
||||
|
||||
/** @column(type="string") */
|
||||
protected $serialNumber;
|
||||
|
||||
public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
|
||||
{
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'serialNumber',
|
||||
'type' => 'string',
|
||||
));
|
||||
}
|
||||
|
||||
}
|
40
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php
vendored
Normal file
40
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869CreditCardPayment.php
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC869;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class DDC869CreditCardPayment extends DDC869Payment
|
||||
{
|
||||
|
||||
/** @column(type="string") */
|
||||
protected $creditCardNumber;
|
||||
|
||||
public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
|
||||
{
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'creditCardNumber',
|
||||
'type' => 'string',
|
||||
));
|
||||
}
|
||||
|
||||
}
|
57
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php
vendored
Normal file
57
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC869;
|
||||
|
||||
/**
|
||||
* @MappedSuperclass(repositoryClass = "Doctrine\Tests\Models\DDC869\DDC869PaymentRepository")
|
||||
*/
|
||||
class DDC869Payment
|
||||
{
|
||||
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/** @column(type="float") */
|
||||
protected $value;
|
||||
|
||||
|
||||
public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata)
|
||||
{
|
||||
$metadata->mapField(array(
|
||||
'id' => true,
|
||||
'fieldName' => 'id',
|
||||
'type' => 'integer',
|
||||
'columnName' => 'id',
|
||||
));
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'value',
|
||||
'type' => 'float',
|
||||
));
|
||||
$metadata->isMappedSuperclass = true;
|
||||
$metadata->setCustomRepositoryClass("Doctrine\Tests\Models\DDC869\DDC869PaymentRepository");
|
||||
$metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadataInfo::GENERATOR_TYPE_AUTO);
|
||||
}
|
||||
|
||||
}
|
37
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869PaymentRepository.php
vendored
Normal file
37
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DDC869/DDC869PaymentRepository.php
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 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\Tests\Models\DDC869;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class DDC869PaymentRepository extends EntityRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* Very complex method
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isTrue()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
64
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/AbstractContentItem.php
vendored
Normal file
64
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/AbstractContentItem.php
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/*
|
||||
* 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\Tests\Models\DirectoryTree;
|
||||
|
||||
/**
|
||||
* @MappedSuperclass
|
||||
*/
|
||||
abstract class AbstractContentItem
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer") @GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="Directory")
|
||||
*/
|
||||
protected $parentDirectory;
|
||||
|
||||
/** @column(type="string") */
|
||||
protected $name;
|
||||
|
||||
public function __construct(Directory $parentDir = null)
|
||||
{
|
||||
$this->parentDirectory = $parentDir;
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getParent()
|
||||
{
|
||||
return $this->parentDirectory;
|
||||
}
|
||||
}
|
41
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/Directory.php
vendored
Normal file
41
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/Directory.php
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/*
|
||||
* 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\Tests\Models\DirectoryTree;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class Directory extends AbstractContentItem
|
||||
{
|
||||
/**
|
||||
* @Column(type="string")
|
||||
*/
|
||||
protected $path;
|
||||
|
||||
public function setPath($path)
|
||||
{
|
||||
$this->path = $path;
|
||||
}
|
||||
|
||||
public function getPath()
|
||||
{
|
||||
return $this->path;
|
||||
}
|
||||
}
|
46
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/File.php
vendored
Normal file
46
vendor/doctrine/orm/tests/Doctrine/Tests/Models/DirectoryTree/File.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/*
|
||||
* 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\Tests\Models\DirectoryTree;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="`file`")
|
||||
*/
|
||||
class File extends AbstractContentItem
|
||||
{
|
||||
/** @Column(type="string") */
|
||||
protected $extension = "html";
|
||||
|
||||
public function __construct(Directory $parent = null)
|
||||
{
|
||||
parent::__construct($parent);
|
||||
}
|
||||
|
||||
public function getExtension()
|
||||
{
|
||||
return $this->extension;
|
||||
}
|
||||
|
||||
public function setExtension($ext)
|
||||
{
|
||||
$this->extension = $ext;
|
||||
}
|
||||
}
|
91
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php
vendored
Normal file
91
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCart.php
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\ECommerce;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* ECommerceCart
|
||||
* Represents a typical cart of a shopping application.
|
||||
*
|
||||
* @author Giorgio Sironi
|
||||
* @Entity
|
||||
* @Table(name="ecommerce_carts")
|
||||
*/
|
||||
class ECommerceCart
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
* @Id
|
||||
* @GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @Column(length=50, nullable=true)
|
||||
*/
|
||||
private $payment;
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="ECommerceCustomer", inversedBy="cart")
|
||||
* @JoinColumn(name="customer_id", referencedColumnName="id")
|
||||
*/
|
||||
private $customer;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="ECommerceProduct", cascade={"persist"})
|
||||
* @JoinTable(name="ecommerce_carts_products",
|
||||
joinColumns={@JoinColumn(name="cart_id", referencedColumnName="id")},
|
||||
inverseJoinColumns={@JoinColumn(name="product_id", referencedColumnName="id")})
|
||||
*/
|
||||
private $products;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->products = new ArrayCollection;
|
||||
}
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getPayment() {
|
||||
return $this->payment;
|
||||
}
|
||||
|
||||
public function setPayment($payment) {
|
||||
$this->payment = $payment;
|
||||
}
|
||||
|
||||
public function setCustomer(ECommerceCustomer $customer) {
|
||||
if ($this->customer !== $customer) {
|
||||
$this->customer = $customer;
|
||||
$customer->setCart($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function removeCustomer() {
|
||||
if ($this->customer !== null) {
|
||||
$customer = $this->customer;
|
||||
$this->customer = null;
|
||||
$customer->removeCart();
|
||||
}
|
||||
}
|
||||
|
||||
public function getCustomer() {
|
||||
return $this->customer;
|
||||
}
|
||||
|
||||
public function getProducts()
|
||||
{
|
||||
return $this->products;
|
||||
}
|
||||
|
||||
public function addProduct(ECommerceProduct $product) {
|
||||
$this->products[] = $product;
|
||||
}
|
||||
|
||||
public function removeProduct(ECommerceProduct $product) {
|
||||
return $this->products->removeElement($product);
|
||||
}
|
||||
}
|
126
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php
vendored
Normal file
126
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\ECommerce;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* ECommerceCategory
|
||||
* Represents a tag applied on particular products.
|
||||
*
|
||||
* @author Giorgio Sironi
|
||||
* @Entity
|
||||
* @Table(name="ecommerce_categories")
|
||||
*/
|
||||
class ECommerceCategory
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @Column(type="string", length=50)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="ECommerceProduct", mappedBy="categories")
|
||||
*/
|
||||
private $products;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="ECommerceCategory", mappedBy="parent", cascade={"persist"})
|
||||
*/
|
||||
private $children;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="ECommerceCategory", inversedBy="children")
|
||||
* @JoinColumn(name="parent_id", referencedColumnName="id")
|
||||
*/
|
||||
private $parent;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->products = new ArrayCollection();
|
||||
$this->children = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function addProduct(ECommerceProduct $product)
|
||||
{
|
||||
if (!$this->products->contains($product)) {
|
||||
$this->products[] = $product;
|
||||
$product->addCategory($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function removeProduct(ECommerceProduct $product)
|
||||
{
|
||||
$removed = $this->products->removeElement($product);
|
||||
if ($removed) {
|
||||
$product->removeCategory($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function getProducts()
|
||||
{
|
||||
return $this->products;
|
||||
}
|
||||
|
||||
private function setParent(ECommerceCategory $parent)
|
||||
{
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
public function getChildren()
|
||||
{
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
public function getParent()
|
||||
{
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
public function addChild(ECommerceCategory $child)
|
||||
{
|
||||
$this->children[] = $child;
|
||||
$child->setParent($this);
|
||||
}
|
||||
|
||||
/** does not set the owning side. */
|
||||
public function brokenAddChild(ECommerceCategory $child)
|
||||
{
|
||||
$this->children[] = $child;
|
||||
}
|
||||
|
||||
|
||||
public function removeChild(ECommerceCategory $child)
|
||||
{
|
||||
$removed = $this->children->removeElement($child);
|
||||
if ($removed) {
|
||||
$child->removeParent();
|
||||
}
|
||||
}
|
||||
|
||||
private function removeParent()
|
||||
{
|
||||
$this->parent = null;
|
||||
}
|
||||
}
|
94
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php
vendored
Normal file
94
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceCustomer.php
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\ECommerce;
|
||||
|
||||
/**
|
||||
* ECommerceCustomer
|
||||
* Represents a registered user of a shopping application.
|
||||
*
|
||||
* @author Giorgio Sironi
|
||||
* @Entity
|
||||
* @Table(name="ecommerce_customers")
|
||||
*/
|
||||
class ECommerceCustomer
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
* @Id
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @Column(type="string", length=50)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="ECommerceCart", mappedBy="customer", cascade={"persist"})
|
||||
*/
|
||||
private $cart;
|
||||
|
||||
/**
|
||||
* Example of a one-one self referential association. A mentor can follow
|
||||
* only one customer at the time, while a customer can choose only one
|
||||
* mentor. Not properly appropriate but it works.
|
||||
*
|
||||
* @OneToOne(targetEntity="ECommerceCustomer", cascade={"persist"}, fetch="EAGER")
|
||||
* @JoinColumn(name="mentor_id", referencedColumnName="id")
|
||||
*/
|
||||
private $mentor;
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function setCart(ECommerceCart $cart)
|
||||
{
|
||||
if ($this->cart !== $cart) {
|
||||
$this->cart = $cart;
|
||||
$cart->setCustomer($this);
|
||||
}
|
||||
}
|
||||
|
||||
/* Does not properly maintain the bidirectional association! */
|
||||
public function brokenSetCart(ECommerceCart $cart) {
|
||||
$this->cart = $cart;
|
||||
}
|
||||
|
||||
public function getCart() {
|
||||
return $this->cart;
|
||||
}
|
||||
|
||||
public function removeCart()
|
||||
{
|
||||
if ($this->cart !== null) {
|
||||
$cart = $this->cart;
|
||||
$this->cart = null;
|
||||
$cart->removeCustomer();
|
||||
}
|
||||
}
|
||||
|
||||
public function setMentor(ECommerceCustomer $mentor)
|
||||
{
|
||||
$this->mentor = $mentor;
|
||||
}
|
||||
|
||||
public function removeMentor()
|
||||
{
|
||||
$this->mentor = null;
|
||||
}
|
||||
|
||||
public function getMentor()
|
||||
{
|
||||
return $this->mentor;
|
||||
}
|
||||
}
|
59
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php
vendored
Normal file
59
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceFeature.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\ECommerce;
|
||||
|
||||
/**
|
||||
* Describes a product feature.
|
||||
*
|
||||
* @author Giorgio Sironi
|
||||
* @Entity
|
||||
* @Table(name="ecommerce_features")
|
||||
*/
|
||||
class ECommerceFeature
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
* @Id
|
||||
* @GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @Column(length=50)
|
||||
*/
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* @ManyToOne(targetEntity="ECommerceProduct", inversedBy="features")
|
||||
* @JoinColumn(name="product_id", referencedColumnName="id")
|
||||
*/
|
||||
private $product;
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getDescription() {
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setDescription($description) {
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
public function setProduct(ECommerceProduct $product) {
|
||||
$this->product = $product;
|
||||
}
|
||||
|
||||
public function removeProduct() {
|
||||
if ($this->product !== null) {
|
||||
$product = $this->product;
|
||||
$this->product = null;
|
||||
$product->removeFeature($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function getProduct() {
|
||||
return $this->product;
|
||||
}
|
||||
}
|
178
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php
vendored
Normal file
178
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php
vendored
Normal file
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\ECommerce;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* ECommerceProduct
|
||||
* Represents a type of product of a shopping application.
|
||||
*
|
||||
* @author Giorgio Sironi
|
||||
* @Entity
|
||||
* @Table(name="ecommerce_products",indexes={@Index(name="name_idx", columns={"name"})})
|
||||
*/
|
||||
class ECommerceProduct
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
* @Id
|
||||
* @GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @Column(type="string", length=50, nullable=true)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="ECommerceShipping", cascade={"persist"})
|
||||
* @JoinColumn(name="shipping_id", referencedColumnName="id")
|
||||
*/
|
||||
private $shipping;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="ECommerceFeature", mappedBy="product", cascade={"persist"})
|
||||
*/
|
||||
private $features;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="ECommerceCategory", cascade={"persist"}, inversedBy="products")
|
||||
* @JoinTable(name="ecommerce_products_categories",
|
||||
* joinColumns={@JoinColumn(name="product_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@JoinColumn(name="category_id", referencedColumnName="id")})
|
||||
*/
|
||||
private $categories;
|
||||
|
||||
/**
|
||||
* This relation is saved with two records in the association table for
|
||||
* simplicity.
|
||||
* @ManyToMany(targetEntity="ECommerceProduct", cascade={"persist"})
|
||||
* @JoinTable(name="ecommerce_products_related",
|
||||
* joinColumns={@JoinColumn(name="product_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@JoinColumn(name="related_id", referencedColumnName="id")})
|
||||
*/
|
||||
private $related;
|
||||
|
||||
public $isCloned = false;
|
||||
public $wakeUp = false;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->features = new ArrayCollection;
|
||||
$this->categories = new ArrayCollection;
|
||||
$this->related = new ArrayCollection;
|
||||
}
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function getShipping()
|
||||
{
|
||||
return $this->shipping;
|
||||
}
|
||||
|
||||
public function setShipping(ECommerceShipping $shipping)
|
||||
{
|
||||
$this->shipping = $shipping;
|
||||
}
|
||||
|
||||
public function removeShipping()
|
||||
{
|
||||
$this->shipping = null;
|
||||
}
|
||||
|
||||
public function getFeatures()
|
||||
{
|
||||
return $this->features;
|
||||
}
|
||||
|
||||
public function addFeature(ECommerceFeature $feature)
|
||||
{
|
||||
$this->features[] = $feature;
|
||||
$feature->setProduct($this);
|
||||
}
|
||||
|
||||
/** does not set the owning side */
|
||||
public function brokenAddFeature(ECommerceFeature $feature)
|
||||
{
|
||||
$this->features[] = $feature;
|
||||
}
|
||||
|
||||
public function removeFeature(ECommerceFeature $feature)
|
||||
{
|
||||
$removed = $this->features->removeElement($feature);
|
||||
if ($removed) {
|
||||
$feature->removeProduct();
|
||||
}
|
||||
return $removed;
|
||||
}
|
||||
|
||||
public function addCategory(ECommerceCategory $category)
|
||||
{
|
||||
if (!$this->categories->contains($category)) {
|
||||
$this->categories[] = $category;
|
||||
$category->addProduct($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function removeCategory(ECommerceCategory $category)
|
||||
{
|
||||
$removed = $this->categories->removeElement($category);
|
||||
if ($removed) {
|
||||
$category->removeProduct($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function getCategories()
|
||||
{
|
||||
return $this->categories;
|
||||
}
|
||||
|
||||
public function getRelated()
|
||||
{
|
||||
return $this->related;
|
||||
}
|
||||
|
||||
public function addRelated(ECommerceProduct $related)
|
||||
{
|
||||
if (!$this->related->contains($related)) {
|
||||
$this->related[] = $related;
|
||||
$related->addRelated($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function removeRelated(ECommerceProduct $related)
|
||||
{
|
||||
$removed = $this->related->removeElement($related);
|
||||
if ($removed) {
|
||||
$related->removeRelated($this);
|
||||
}
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->isCloned = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Testing docblock contents here
|
||||
*/
|
||||
public function __wakeup()
|
||||
{
|
||||
$this->wakeUp = true;
|
||||
}
|
||||
}
|
40
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceShipping.php
vendored
Normal file
40
vendor/doctrine/orm/tests/Doctrine/Tests/Models/ECommerce/ECommerceShipping.php
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\ECommerce;
|
||||
|
||||
/**
|
||||
* ECommerceShipping
|
||||
* Represents a shipping method.
|
||||
*
|
||||
* @author Giorgio Sironi
|
||||
* @Entity
|
||||
* @Table(name="ecommerce_shippings")
|
||||
*/
|
||||
class ECommerceShipping
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
*/
|
||||
private $days;
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getDays()
|
||||
{
|
||||
return $this->days;
|
||||
}
|
||||
|
||||
public function setDays($days)
|
||||
{
|
||||
$this->days = $days;
|
||||
}
|
||||
}
|
14
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php
vendored
Normal file
14
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Forum;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
*/
|
||||
class ForumAdministrator extends ForumUser
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer", name="access_level")
|
||||
*/
|
||||
public $accessLevel;
|
||||
}
|
17
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAvatar.php
vendored
Normal file
17
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumAvatar.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Forum;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="forum_avatars")
|
||||
*/
|
||||
class ForumAvatar
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $id;
|
||||
}
|
28
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumBoard.php
vendored
Normal file
28
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumBoard.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Forum;
|
||||
|
||||
/**
|
||||
* Represents a board in a forum.
|
||||
*
|
||||
* @author robo
|
||||
* @Entity
|
||||
* @Table(name="forum_boards")
|
||||
*/
|
||||
class ForumBoard
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
*/
|
||||
public $position;
|
||||
/**
|
||||
* @ManyToOne(targetEntity="ForumCategory", inversedBy="boards")
|
||||
* @JoinColumn(name="category_id", referencedColumnName="id")
|
||||
*/
|
||||
public $category;
|
||||
}
|
32
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumCategory.php
vendored
Normal file
32
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumCategory.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Forum;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="forum_categories")
|
||||
*/
|
||||
class ForumCategory
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
* @Id
|
||||
*/
|
||||
private $id;
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
*/
|
||||
public $position;
|
||||
/**
|
||||
* @Column(type="string", length=255)
|
||||
*/
|
||||
public $name;
|
||||
/**
|
||||
* @OneToMany(targetEntity="ForumBoard", mappedBy="category")
|
||||
*/
|
||||
public $boards;
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
}
|
26
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumEntry.php
vendored
Normal file
26
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumEntry.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Forum;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="forum_entries")
|
||||
*/
|
||||
class ForumEntry
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(type="string", length=50)
|
||||
*/
|
||||
public $topic;
|
||||
|
||||
public function &getTopicByReference() {
|
||||
return $this->topic;
|
||||
}
|
||||
}
|
||||
|
41
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumUser.php
vendored
Normal file
41
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Forum/ForumUser.php
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Forum;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="forum_users")
|
||||
*/
|
||||
class ForumUser
|
||||
{
|
||||
/**
|
||||
* @Column(type="integer")
|
||||
* @Id @GeneratedValue
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(type="string", length=50)
|
||||
*/
|
||||
public $username;
|
||||
/**
|
||||
* @OneToOne(targetEntity="ForumAvatar", cascade={"persist"})
|
||||
* @JoinColumn(name="avatar_id", referencedColumnName="id")
|
||||
*/
|
||||
public $avatar;
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getUsername() {
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
public function getAvatar() {
|
||||
return $this->avatar;
|
||||
}
|
||||
|
||||
public function setAvatar(ForumAvatar $avatar) {
|
||||
$this->avatar = $avatar;
|
||||
}
|
||||
}
|
20
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/BooleanModel.php
vendored
Normal file
20
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/BooleanModel.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Generic;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="boolean_model")
|
||||
*/
|
||||
class BooleanModel
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(type="boolean")
|
||||
*/
|
||||
public $booleanField;
|
||||
}
|
28
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/DateTimeModel.php
vendored
Normal file
28
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/DateTimeModel.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Generic;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="date_time_model")
|
||||
*/
|
||||
class DateTimeModel
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(name="col_datetime", type="datetime", nullable=true)
|
||||
*/
|
||||
public $datetime;
|
||||
/**
|
||||
* @Column(name="col_date", type="date", nullable=true)
|
||||
*/
|
||||
public $date;
|
||||
/**
|
||||
* @Column(name="col_time", type="time", nullable=true)
|
||||
*/
|
||||
public $time;
|
||||
}
|
25
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/DecimalModel.php
vendored
Normal file
25
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/DecimalModel.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Generic;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="decimal_model")
|
||||
*/
|
||||
class DecimalModel
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(name="`decimal`", type="decimal", scale=2, precision=5)
|
||||
*/
|
||||
public $decimal;
|
||||
|
||||
/**
|
||||
* @Column(name="`high_scale`", type="decimal", scale=4, precision=14)
|
||||
*/
|
||||
public $highScale;
|
||||
}
|
25
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/SerializationModel.php
vendored
Normal file
25
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Generic/SerializationModel.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Generic;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="serialize_model")
|
||||
*/
|
||||
class SerializationModel
|
||||
{
|
||||
/**
|
||||
* @Id @Column(type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $id;
|
||||
/**
|
||||
* @Column(name="the_array", type="array", nullable=true)
|
||||
*/
|
||||
public $array;
|
||||
|
||||
/**
|
||||
* @Column(name="the_obj", type="object", nullable=true)
|
||||
*/
|
||||
public $object;
|
||||
}
|
68
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Global/GlobalNamespaceModel.php
vendored
Normal file
68
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Global/GlobalNamespaceModel.php
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @entity
|
||||
* @table(name="articles")
|
||||
*/
|
||||
class DoctrineGlobal_Article
|
||||
{
|
||||
/**
|
||||
* @id
|
||||
* @column(type="int")
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @column(type="string")
|
||||
*/
|
||||
protected $headline;
|
||||
|
||||
/**
|
||||
* @column(type="text")
|
||||
*/
|
||||
protected $text;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="DoctrineGlobal_User")
|
||||
* @JoinTable(name="author_articles",
|
||||
* joinColumns={@JoinColumn(name="article_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@JoinColumn(name="author_id", referencedColumnName="id", unique=true)}
|
||||
* )
|
||||
*/
|
||||
protected $author;
|
||||
|
||||
/**
|
||||
* @ManyToMany(targetEntity="\DoctrineGlobal_User")
|
||||
* @JoinTable(name="editor_articles",
|
||||
* joinColumns={@JoinColumn(name="article_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@JoinColumn(name="editor_id", referencedColumnName="id", unique=true)}
|
||||
* )
|
||||
*/
|
||||
protected $editor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="users")
|
||||
*/
|
||||
class DoctrineGlobal_User
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @column(type="integer")
|
||||
* @var int
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @column(type="string", length=64)
|
||||
* @var string
|
||||
*/
|
||||
private $username;
|
||||
|
||||
/**
|
||||
* @column(type="string", length=128)
|
||||
* @var string
|
||||
*/
|
||||
private $email;
|
||||
}
|
33
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyArticle.php
vendored
Normal file
33
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyArticle.php
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Legacy;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="legacy_articles")
|
||||
*/
|
||||
class LegacyArticle
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @Column(name="iArticleId", type="integer")
|
||||
* @GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
public $_id;
|
||||
/**
|
||||
* @Column(name="sTopic", type="string", length=255)
|
||||
*/
|
||||
public $_topic;
|
||||
/**
|
||||
* @Column(name="sText", type="text")
|
||||
*/
|
||||
public $_text;
|
||||
/**
|
||||
* @ManyToOne(targetEntity="LegacyUser", inversedBy="_articles")
|
||||
* @JoinColumn(name="iUserId", referencedColumnName="iUserId")
|
||||
*/
|
||||
public $_user;
|
||||
public function setAuthor(LegacyUser $author) {
|
||||
$this->_user = $author;
|
||||
}
|
||||
}
|
41
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyCar.php
vendored
Normal file
41
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyCar.php
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Legacy;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="legacy_cars")
|
||||
*/
|
||||
class LegacyCar
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @GeneratedValue
|
||||
* @Column(name="iCarId", type="integer", nullable=false)
|
||||
*/
|
||||
public $_id;
|
||||
/**
|
||||
* @ManyToMany(targetEntity="LegacyUser", mappedBy="_cars")
|
||||
*/
|
||||
public $_users;
|
||||
|
||||
/**
|
||||
* @Column(name="sDescription", type="string", length=255, unique=true)
|
||||
*/
|
||||
public $_description;
|
||||
|
||||
function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
}
|
||||
|
||||
public function addUser(LegacyUser $user) {
|
||||
$this->_users[] = $user;
|
||||
}
|
||||
|
||||
public function getUsers() {
|
||||
return $this->_users;
|
||||
}
|
||||
}
|
80
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUser.php
vendored
Normal file
80
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUser.php
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Legacy;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="legacy_users")
|
||||
*/
|
||||
class LegacyUser
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @GeneratedValue
|
||||
* @Column(name="iUserId", type="integer", nullable=false)
|
||||
*/
|
||||
public $_id;
|
||||
/**
|
||||
* @Column(name="sUsername", type="string", length=255, unique=true)
|
||||
*/
|
||||
public $_username;
|
||||
/**
|
||||
* @Column(type="string", length=255, name="name")
|
||||
*/
|
||||
public $_name;
|
||||
/**
|
||||
* @OneToMany(targetEntity="LegacyArticle", mappedBy="_user")
|
||||
*/
|
||||
public $_articles;
|
||||
/**
|
||||
* @OneToMany(targetEntity="LegacyUserReference", mappedBy="_source", cascade={"remove"})
|
||||
*/
|
||||
public $_references;
|
||||
/**
|
||||
* @ManyToMany(targetEntity="LegacyCar", inversedBy="_users", cascade={"persist", "merge"})
|
||||
* @JoinTable(name="legacy_users_cars",
|
||||
* joinColumns={@JoinColumn(name="iUserId", referencedColumnName="iUserId")},
|
||||
* inverseJoinColumns={@JoinColumn(name="iCarId", referencedColumnName="iCarId")}
|
||||
* )
|
||||
*/
|
||||
public $_cars;
|
||||
public function __construct() {
|
||||
$this->_articles = new ArrayCollection;
|
||||
$this->_references = new ArrayCollection;
|
||||
$this->_cars = new ArrayCollection;
|
||||
}
|
||||
|
||||
public function getId() {
|
||||
return $this->_id;
|
||||
}
|
||||
|
||||
public function getUsername() {
|
||||
return $this->_username;
|
||||
}
|
||||
|
||||
public function addArticle(LegacyArticle $article) {
|
||||
$this->_articles[] = $article;
|
||||
$article->setAuthor($this);
|
||||
}
|
||||
|
||||
public function addReference($reference)
|
||||
{
|
||||
$this->_references[] = $reference;
|
||||
}
|
||||
|
||||
public function references()
|
||||
{
|
||||
return $this->_references;
|
||||
}
|
||||
|
||||
public function addCar(LegacyCar $car) {
|
||||
$this->_cars[] = $car;
|
||||
$car->addUser($this);
|
||||
}
|
||||
|
||||
public function getCars() {
|
||||
return $this->_cars;
|
||||
}
|
||||
}
|
65
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUserReference.php
vendored
Normal file
65
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Legacy/LegacyUserReference.php
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Legacy;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="legacy_users_reference")
|
||||
*/
|
||||
class LegacyUserReference
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @ManyToOne(targetEntity="LegacyUser", inversedBy="_references")
|
||||
* @JoinColumn(name="iUserIdSource", referencedColumnName="iUserId")
|
||||
*/
|
||||
private $_source;
|
||||
|
||||
/**
|
||||
* @Id
|
||||
* @ManyToOne(targetEntity="LegacyUser")
|
||||
* @JoinColumn(name="iUserIdTarget", referencedColumnName="iUserId")
|
||||
*/
|
||||
private $_target;
|
||||
|
||||
/**
|
||||
* @column(type="string", name="description")
|
||||
*/
|
||||
private $_description;
|
||||
|
||||
/**
|
||||
* @column(type="datetime", name="created")
|
||||
*/
|
||||
private $_created;
|
||||
|
||||
public function __construct($source, $target, $description)
|
||||
{
|
||||
$source->addReference($this);
|
||||
$target->addReference($this);
|
||||
|
||||
$this->_source = $source;
|
||||
$this->_target = $target;
|
||||
$this->_description = $description;
|
||||
$this->_created = new \DateTime("now");
|
||||
}
|
||||
|
||||
public function source()
|
||||
{
|
||||
return $this->_source;
|
||||
}
|
||||
|
||||
public function target()
|
||||
{
|
||||
return $this->_target;
|
||||
}
|
||||
|
||||
public function setDescription($desc)
|
||||
{
|
||||
$this->_description = $desc;
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->_description;
|
||||
}
|
||||
}
|
39
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavCountry.php
vendored
Normal file
39
vendor/doctrine/orm/tests/Doctrine/Tests/Models/Navigation/NavCountry.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Doctrine\Tests\Models\Navigation;
|
||||
|
||||
/**
|
||||
* @Entity
|
||||
* @Table(name="navigation_countries")
|
||||
*/
|
||||
class NavCountry
|
||||
{
|
||||
/**
|
||||
* @Id
|
||||
* @Column(type="integer")
|
||||
* @generatedValue
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @Column(type="string")
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @OneToMany(targetEntity="NavPointOfInterest", mappedBy="country")
|
||||
*/
|
||||
private $pois;
|
||||
|
||||
function __construct($name) {
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function getId() {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user