Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
60
vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
vendored
Normal file
60
vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/LifecycleEventArgs.php
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Persistence\Event;
|
||||
|
||||
use Doctrine\Common\EventArgs;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
|
||||
/**
|
||||
* Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions
|
||||
* of entities.
|
||||
*/
|
||||
class LifecycleEventArgs extends EventArgs
|
||||
{
|
||||
/** @var ObjectManager */
|
||||
private $objectManager;
|
||||
|
||||
/** @var object */
|
||||
private $object;
|
||||
|
||||
/**
|
||||
* @param object $object
|
||||
*/
|
||||
public function __construct($object, ObjectManager $objectManager)
|
||||
{
|
||||
$this->object = $object;
|
||||
$this->objectManager = $objectManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the associated entity.
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function getEntity()
|
||||
{
|
||||
return $this->object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the associated object.
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function getObject()
|
||||
{
|
||||
return $this->object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the associated ObjectManager.
|
||||
*
|
||||
* @return ObjectManager
|
||||
*/
|
||||
public function getObjectManager()
|
||||
{
|
||||
return $this->objectManager;
|
||||
}
|
||||
}
|
45
vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
vendored
Normal file
45
vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/LoadClassMetadataEventArgs.php
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Persistence\Event;
|
||||
|
||||
use Doctrine\Common\EventArgs;
|
||||
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
|
||||
/**
|
||||
* Class that holds event arguments for a loadMetadata event.
|
||||
*/
|
||||
class LoadClassMetadataEventArgs extends EventArgs
|
||||
{
|
||||
/** @var ClassMetadata */
|
||||
private $classMetadata;
|
||||
|
||||
/** @var ObjectManager */
|
||||
private $objectManager;
|
||||
|
||||
public function __construct(ClassMetadata $classMetadata, ObjectManager $objectManager)
|
||||
{
|
||||
$this->classMetadata = $classMetadata;
|
||||
$this->objectManager = $objectManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the associated ClassMetadata.
|
||||
*
|
||||
* @return ClassMetadata
|
||||
*/
|
||||
public function getClassMetadata()
|
||||
{
|
||||
return $this->classMetadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the associated ObjectManager.
|
||||
*
|
||||
* @return ObjectManager
|
||||
*/
|
||||
public function getObjectManager()
|
||||
{
|
||||
return $this->objectManager;
|
||||
}
|
||||
}
|
30
vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
vendored
Normal file
30
vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/ManagerEventArgs.php
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Persistence\Event;
|
||||
|
||||
use Doctrine\Common\EventArgs;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
|
||||
/**
|
||||
* Provides event arguments for the preFlush event.
|
||||
*/
|
||||
class ManagerEventArgs extends EventArgs
|
||||
{
|
||||
/** @var ObjectManager */
|
||||
private $objectManager;
|
||||
|
||||
public function __construct(ObjectManager $objectManager)
|
||||
{
|
||||
$this->objectManager = $objectManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the associated ObjectManager.
|
||||
*
|
||||
* @return ObjectManager
|
||||
*/
|
||||
public function getObjectManager()
|
||||
{
|
||||
return $this->objectManager;
|
||||
}
|
||||
}
|
58
vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
vendored
Normal file
58
vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/OnClearEventArgs.php
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Persistence\Event;
|
||||
|
||||
use Doctrine\Common\EventArgs;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
|
||||
/**
|
||||
* Provides event arguments for the onClear event.
|
||||
*/
|
||||
class OnClearEventArgs extends EventArgs
|
||||
{
|
||||
/** @var ObjectManager */
|
||||
private $objectManager;
|
||||
|
||||
/** @var string|null */
|
||||
private $entityClass;
|
||||
|
||||
/**
|
||||
* @param ObjectManager $objectManager The object manager.
|
||||
* @param string|null $entityClass The optional entity class.
|
||||
*/
|
||||
public function __construct($objectManager, $entityClass = null)
|
||||
{
|
||||
$this->objectManager = $objectManager;
|
||||
$this->entityClass = $entityClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the associated ObjectManager.
|
||||
*
|
||||
* @return ObjectManager
|
||||
*/
|
||||
public function getObjectManager()
|
||||
{
|
||||
return $this->objectManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the entity class that is cleared, or null if all are cleared.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getEntityClass()
|
||||
{
|
||||
return $this->entityClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this event clears all entities.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clearsAllEntities()
|
||||
{
|
||||
return $this->entityClass === null;
|
||||
}
|
||||
}
|
113
vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
vendored
Normal file
113
vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Event/PreUpdateEventArgs.php
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
<?php
|
||||
|
||||
namespace Doctrine\Common\Persistence\Event;
|
||||
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
use InvalidArgumentException;
|
||||
use function get_class;
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* Class that holds event arguments for a preUpdate event.
|
||||
*/
|
||||
class PreUpdateEventArgs extends LifecycleEventArgs
|
||||
{
|
||||
/** @var mixed[][] */
|
||||
private $entityChangeSet;
|
||||
|
||||
/**
|
||||
* @param object $entity
|
||||
* @param mixed[][] $changeSet
|
||||
*/
|
||||
public function __construct($entity, ObjectManager $objectManager, array &$changeSet)
|
||||
{
|
||||
parent::__construct($entity, $objectManager);
|
||||
|
||||
$this->entityChangeSet = &$changeSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the entity changeset.
|
||||
*
|
||||
* @return mixed[][]
|
||||
*/
|
||||
public function getEntityChangeSet()
|
||||
{
|
||||
return $this->entityChangeSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if field has a changeset.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasChangedField($field)
|
||||
{
|
||||
return isset($this->entityChangeSet[$field]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the old value of the changeset of the changed field.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getOldValue($field)
|
||||
{
|
||||
$this->assertValidField($field);
|
||||
|
||||
return $this->entityChangeSet[$field][0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the new value of the changeset of the changed field.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getNewValue($field)
|
||||
{
|
||||
$this->assertValidField($field);
|
||||
|
||||
return $this->entityChangeSet[$field][1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the new value of this field.
|
||||
*
|
||||
* @param string $field
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setNewValue($field, $value)
|
||||
{
|
||||
$this->assertValidField($field);
|
||||
|
||||
$this->entityChangeSet[$field][1] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts the field exists in changeset.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
private function assertValidField($field)
|
||||
{
|
||||
if (! isset($this->entityChangeSet[$field])) {
|
||||
throw new InvalidArgumentException(sprintf(
|
||||
'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.',
|
||||
$field,
|
||||
get_class($this->getObject())
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue