30 search results

// ... lines 1 - 10
class TreasuresAllowedOwnerChangeValidator extends ConstraintValidator
{
// ... lines 13 - 16
public function validate($value, Constraint $constraint)
{
// ... lines 19 - 24
// meant to be used above a Collection field
assert($value instanceof Collection);
$unitOfWork = $this->entityManager->getUnitOfWork();
// ... lines 29 - 39
}
}
See Code Block in Script
…this point. And so, believe the logic actually becomes a bit simpler. To get the "original value", instead of using using Doctrine's UnitOfWork, we could just query for the CheeseListing entity itself inside the validator and read *its* value. Well, to do that, we…
weaverryan
weaverryan
Read Full Comment
…What I DO know is this: A) On a PUT (edit), API Platform queries for your object. This puts it into the "identity map" of Doctrine's UnitOfWork. Unless you have some customization, the class that should be handling that is this one: https://github…
weaverryan
weaverryan
Read Full Comment
…Doctrine... sorta "forgets" that it knows about it. Specifically, the UnitOfWork keeps track of every entity that it has queried for or saved during a request. The error we're seeing (I believe) is that you've queried for this `CartProduct`... then when everything saves..…
weaverryan
weaverryan
Read Full Comment
…doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php", "line": 1852, "args": [ [ "object", "App\\Entity\\Users" ], [ "string", "removed" ] ] }, { "namespace": "Doctrine\\ORM", "short_class": "UnitOfWork", "class": "Doctrine\\ORM\\UnitOfWork", "type": "->", "function": "doRemove", "file": "/Users/me/Documents/Projects/api-platform/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php", …
…however, when persisting, I have the message "Argument must be of type array", object given, does it mean that despite OneToOne relationship, my getter for the profile property in User class must return an ArrayCollection? The exception is in the file UnitOfWork.php of Doctrine.
Benoit L.
Benoit L.
Read Full Comment
…lib/Doctrine/ORM/UnitOfWork.php:840 /home/vagrant/code/phpunit/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:740 /home/vagrant/code/phpunit/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:452 /home/vagrant/code/phpunit/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:765…
…ORM/Event/ListenersInvoker.php:98 { …} ./vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1033 { …} ./vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1999 { …} ./vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1956 { …} ./vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:665…
…seems Paginator doesn't work well with aggregation results and gets a wrong $data object this way with 'results' and 'count'. Resulting in Notice: Undefined index: _id ``` "file": "/Users/danny.matthijs/Projects/app/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/UnitOfWork.php", "line": 2831, ```
…object(Product)))) (vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:3445) at Doctrine\ORM\UnitOfWork->assertThatThereAreNoUnintentionallyNonPersistedAssociations() (vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:364) at Doctrine\ORM\UnitOfWork->commit(null) (vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:359) at Doctrine\ORM\EntityManager->flush…