File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/MartinGeorgiev/Doctrine/DBAL/Types Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 77use Doctrine \DBAL \Platforms \AbstractPlatform ;
88use MartinGeorgiev \Doctrine \DBAL \Types \Exceptions \InvalidLtreeForDatabaseException ;
99use MartinGeorgiev \Doctrine \DBAL \Types \Exceptions \InvalidLtreeForPHPException ;
10+ use MartinGeorgiev \Doctrine \DBAL \Types \ValueObject \Exceptions \InvalidLtreeException ;
1011use MartinGeorgiev \Doctrine \DBAL \Types \ValueObject \Ltree as LtreeValueObject ;
1112
13+ /**
14+ * Implementation of PostgreSQL LTREE data type.
15+ *
16+ * @see https://www.postgresql.org/docs/13/ltree.html
17+ * @since 3.5
18+ *
19+ * @author Pierre-Yves Landuré
20+ */
1221final class Ltree extends BaseType
1322{
1423 protected const TYPE_NAME = 'ltree ' ;
@@ -23,7 +32,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?LtreeVal
2332 if (\is_string ($ value )) {
2433 try {
2534 return LtreeValueObject::fromString ($ value );
26- } catch (\ InvalidArgumentException ) {
35+ } catch (InvalidLtreeException ) {
2736 throw InvalidLtreeForDatabaseException::forInvalidFormat ($ value );
2837 }
2938 }
@@ -41,7 +50,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): ?str
4150 if (\is_string ($ value )) {
4251 try {
4352 $ value = LtreeValueObject::fromString ($ value );
44- } catch (\ InvalidArgumentException ) {
53+ } catch (InvalidLtreeException ) {
4554 throw InvalidLtreeForPHPException::forInvalidFormat ($ value );
4655 }
4756 }
You can’t perform that action at this time.
0 commit comments