This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier aa1676c7b5 merged branch henrikbjorn/doctrine-unique-validator (PR #3275)
Commits
-------

928e352 Change the array access used in UniqueEntityValidator

Discussion
----------

[DoctrineBridge] Change the array access used in UniqueEntityValidator

MongoDB ODM Cursor does not implement ArrayAccess and therefor using
`$result[0]` will fail. `reset()` rewinds the array and returns the
first element value.

DoctrineMongoDBBundle#77

/cc @beberlei

---------------------------------------------------------------------------

by henrikbjorn at 2012-02-06T08:09:25Z

Made a mistake, the findBy call would still return a cursor. Changed the findBy to findOneBy we only want one result anyway.

---------------------------------------------------------------------------

by stof at 2012-02-06T08:11:26Z

findOneBy is wrong: you will not detect duplicate anymore if you return a single element

---------------------------------------------------------------------------

by henrikbjorn at 2012-02-06T08:28:03Z

@stof before it was only the first result that was used anyway so if it had found 3 results it would only have used the first one. Performance is apparently the biggest issue with findOneBy so this have been reverted.

---------------------------------------------------------------------------

by stof at 2012-02-06T08:31:17Z

@henrikbjorn no, we use other results too: if ``count()`` is not 1, the validation fails

---------------------------------------------------------------------------

by stof at 2012-02-06T08:36:06Z

Btw, running the testsuite would have tell you there is an issue when using findOneBy as it was breaking a test :)

---------------------------------------------------------------------------

by bschussek at 2012-02-06T10:45:44Z

Why doesn't this validator use a SELECT COUNT anyway?

---------------------------------------------------------------------------

by stof at 2012-02-06T10:57:00Z

@bschussek because we need to check if an existing value is for the same object or another one. Otherwise, the valdiation would fail as soon as you are editing an existing object without changing the unique value

---------------------------------------------------------------------------

by henrikbjorn at 2012-02-06T11:03:40Z

@stof @bschussek other changes that should be done? Else it should be ready to be merged ?

---------------------------------------------------------------------------

by henrikbjorn at 2012-02-06T13:00:57Z

@stof done an rebased.

---------------------------------------------------------------------------

by bschussek at 2012-02-06T13:04:44Z

👍 /cc @fabpot
2012-02-06 14:06:46 +01:00
src/Symfony merged branch henrikbjorn/doctrine-unique-validator (PR #3275) 2012-02-06 14:06:46 +01:00
tests merged branch grizlik/master (PR #3261) 2012-02-06 09:56:24 +01:00
.gitignore Added vendor directory to .gitignore 2010-06-24 10:44:28 +02:00
.travis.yml also test PHP 5.3.2, since this is the official lowest supported PHP version 2011-12-26 01:15:21 +01:00
autoload.php.dist [Tests] [Propel] Added some tests for the ModelChoiceList class 2012-02-05 23:08:07 +01:00
CHANGELOG-2.0.md updated CHANGELOG for 2.0.9 2012-01-06 07:48:27 +01:00
CHANGELOG-2.1.md merged branch bschussek/issue3239 (PR #3256) 2012-02-02 17:28:40 +01:00
check_cs [Check CS] don't replace 'else if' on twig files (closes #2961) 2011-12-27 16:10:32 +01:00
composer.json Revert "merged 2.0" 2012-01-08 20:43:02 +01:00
CONTRIBUTORS.md update CONTRIBUTORS for 2.0.9 2012-01-06 07:49:05 +01:00
LICENSE added the LICENSE file for the YAML component 2011-02-18 11:52:11 +01:00
phpunit.xml.dist [Security] cleaned up opt-in to benchmark test 2011-03-06 20:06:13 +01:00
README.md set travis-ci icon to master 2011-11-23 11:36:09 +01:00
UPGRADE-2.1.md merged branch bschussek/issue2615 (PR #3228) 2012-02-02 10:16:32 +01:00
vendors.php updated Twig to 1.5.1 to fix a regression 2012-01-05 16:02:00 +01:00

README

Build Status

What is Symfony2?

Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.

Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.

Requirements

Symfony2 is only supported on PHP 5.3.2 and up.

Installation

The best way to install Symfony2 is to download the Symfony Standard Edition available at http://symfony.com/download.

Documentation

The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony2 can help speed up your development and take the quality of your work to the next level, read the official Symfony2 documentation.

Contributing

Symfony2 is an open source, community-driven project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.