mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
improve addresses
This commit is contained in:
parent
b4e78a948b
commit
addcf72ae6
@ -21,7 +21,7 @@ class PointType extends Type {
|
|||||||
*
|
*
|
||||||
* @param array $fieldDeclaration
|
* @param array $fieldDeclaration
|
||||||
* @param AbstractPlatform $platform
|
* @param AbstractPlatform $platform
|
||||||
* @return type
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
|
public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
|
||||||
{
|
{
|
||||||
@ -32,7 +32,7 @@ class PointType extends Type {
|
|||||||
*
|
*
|
||||||
* @param type $value
|
* @param type $value
|
||||||
* @param AbstractPlatform $platform
|
* @param AbstractPlatform $platform
|
||||||
* @return Point
|
* @return ?Point
|
||||||
*/
|
*/
|
||||||
public function convertToPHPValue($value, AbstractPlatform $platform)
|
public function convertToPHPValue($value, AbstractPlatform $platform)
|
||||||
{
|
{
|
||||||
|
@ -383,6 +383,16 @@ class Address
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function createFromAddressReference(AddressReference $original): Address
|
||||||
|
{
|
||||||
|
return (new Address())
|
||||||
|
->setPoint($original->getPoint())
|
||||||
|
->setPostcode($original->getPostcode())
|
||||||
|
->setStreet($original->getStreet())
|
||||||
|
->setStreetNumber($original->getStreetNumber())
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
public function getStreet(): ?string
|
public function getStreet(): ?string
|
||||||
{
|
{
|
||||||
return $this->street;
|
return $this->street;
|
||||||
|
@ -36,6 +36,14 @@ final class AddressReferenceRepository implements ObjectRepository
|
|||||||
return $this->repository->findAll();
|
return $this->repository->findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function countAll(): int
|
||||||
|
{
|
||||||
|
$qb = $this->repository->createQueryBuilder('ar');
|
||||||
|
$qb->select('count(ar.id)');
|
||||||
|
|
||||||
|
return $qb->getQuery()->getSingleScalarResult();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return AddressReference[]
|
* @return AddressReference[]
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user