Skip to content

Commit

Permalink
Document LockMode enums
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Jan 2, 2022
1 parent 5901848 commit 7e5d03a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Doctrine/ORM/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ public function flush($entity = null)
* @param int|null $lockVersion The version of the entity to find when using
* optimistic locking.
* @psalm-param class-string<T> $className
* @psalm-param LockMode::*|null $lockMode
*
* @return object|null The entity instance or NULL if the entity can not be found.
* @psalm-return ?T
Expand Down Expand Up @@ -990,6 +991,8 @@ public function hasFilters()
}

/**
* @psalm-param LockMode::* $lockMode
*
* @throws OptimisticLockException
* @throws TransactionRequiredException
*/
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/EntityManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use DateTimeInterface;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\LockMode;
use Doctrine\ORM\Internal\Hydration\AbstractHydrator;
use Doctrine\ORM\Proxy\ProxyFactory;
use Doctrine\ORM\Query\Expr;
Expand Down Expand Up @@ -237,6 +238,7 @@ public function copy($entity, $deep = false);
* @param object $entity
* @param int $lockMode
* @param int|DateTimeInterface|null $lockVersion
* @psalm-param LockMode::* $lockMode
*
* @return void
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Doctrine/ORM/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\Selectable;
use Doctrine\DBAL\LockMode;
use Doctrine\Deprecations\Deprecation;
use Doctrine\Inflector\Inflector;
use Doctrine\Inflector\InflectorFactory;
Expand Down Expand Up @@ -164,6 +165,7 @@ public function clear()
* or NULL if no specific lock mode should be used
* during the search.
* @param int|null $lockVersion The lock version.
* @psalm-param LockMode::*|null $lockMode
*
* @return object|null The entity instance or NULL if the entity can not be found.
* @psalm-return ?T
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,7 @@ public function lock(array $criteria, $lockMode)
* Gets the FROM and optionally JOIN conditions to lock the entity managed by this persister.
*
* @param int|null $lockMode One of the Doctrine\DBAL\LockMode::* constants.
* @psalm-param LockMode::*|null $lockMode
*
* @return string
*/
Expand Down
5 changes: 5 additions & 0 deletions lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Doctrine\ORM\Persisters\Entity;

use Doctrine\Common\Collections\Criteria;
use Doctrine\DBAL\LockMode;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\MappingException;
use Doctrine\ORM\PersistentCollection;
Expand Down Expand Up @@ -54,6 +55,7 @@ public function getInsertSQL();
* @param int|null $limit
* @param int|null $offset
* @param mixed[]|null $orderBy
* @psalm-param LockMode::*|null $lockMode
*
* @return string
*/
Expand Down Expand Up @@ -185,6 +187,7 @@ public function getOwningTable($fieldName);
* @psalm-param array<string, mixed> $criteria
* @psalm-param array<string, mixed>|null $assoc
* @psalm-param array<string, mixed> $hints
* @psalm-param LockMode::*|null $lockMode
* @psalm-param array<string, string>|null $orderBy
*
* @return object|null The loaded and managed entity instance or NULL if the entity can not be found.
Expand Down Expand Up @@ -239,6 +242,7 @@ public function loadOneToOneEntity(array $assoc, $sourceEntity, array $identifie
* @psalm-param array<string, mixed> $id The identifier of the entity as an
* associative array from column or
* field names to values.
* @psalm-param LockMode::*|null $lockMode
*
* @return void
*/
Expand Down Expand Up @@ -300,6 +304,7 @@ public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentC
*
* @param int $lockMode One of the Doctrine\DBAL\LockMode::* constants.
* @psalm-param array<string, mixed> $criteria
* @psalm-param LockMode::* $lockMode
*
* @return void
*/
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/ORM/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ public function setHydrationMode($hydrationMode): self
* @see \Doctrine\DBAL\LockMode
*
* @param int $lockMode
* @psalm-param LockMode::* $lockMode
*
* @throws TransactionRequiredException
*/
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/ORM/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -2457,6 +2457,7 @@ static function ($assoc) {
*
* @param object $entity
* @param int|DateTimeInterface|null $lockVersion
* @psalm-param LockMode::* $lockMode
*
* @throws ORMInvalidArgumentException
* @throws TransactionRequiredException
Expand Down

0 comments on commit 7e5d03a

Please sign in to comment.