Use JTable store with Geometry type

For Joomla! 5.x Coding related discussions, you could also use:

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Jul 07, 2024 2:06 pm

Use JTable store with Geometry type

Post by JayJoom » Sun Jul 07, 2024 2:15 pm


I would like to make use of JTable::store to update a Geometry value in my database.
The Geometry value is given like "POINT(x,y)". If I make the query by myself it must make use of ST_GeomFromText, e.g.
UPDATE '#__com_tbl' SET 'location' = ST_GeomFromText("POINT(x,y)")
The JTable::store function calls however a quotation-function which alters the query - if I use store to:
UPDATE '#__com_tbl' SET 'location' = "ST_GeomFromText(POINT(x,y))"
which doesn't work due to the mysql-Instruction ST_GeomFromText which is now considered as text.

Are there any possibilities?

Joomla! Explorer
Joomla! Explorer
Posts: 362
Joined: Thu Oct 29, 2009 8:28 am
Location: UK

Re: Use JTable store with Geometry type

Post by MarkRS » Tue Jul 09, 2024 11:30 am

Given that no-one who has a definitive answer has come forward I'll put in my two-penny worth.

I'd say you will need to override the Joomla Table Store method. I hope this isn't simply an egg-sucking response.
It's a community, the more we all contribute, the better it will be.


Post Reply

Return to “Joomla! 5.x Coding”