/**
* @template TEntity of ModelEntity
*
* @param ArrayCollection<array-key, TEntity> $collection
* @param array<string, mixed> $conditions
*
* @return TEntity|null
*/
protected function getCollectionElementByProperties(Collection
$collection, array
$conditions) { foreach ($conditions as $property =>
$value) { $entity =
$this->
getCollectionElementByProperty( $collection,
$property,
$value );
if ($entity) { return $entity;
} } return null;
}