A
A
Anton2013-11-24 23:11:47
MySQL
Anton, 2013-11-24 23:11:47

How to implement SQL query in LiveStreet?

Hello!
I am developing a small plugin that will require adding, displaying, editing and deleting an entry in the database. I tried to find something similar in plug-ins "out of the box", but I did not fully understand it.
Let's say there is a table table, and the fields in it are: id, user_id and date_add.
I would be very grateful if you describe in detail what to write in which file, using the table above as an example.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Elizarov, 2013-11-25
@beauty_free

I suggest you contact me as the question is a little more broad than it seems.
If without voluminous specific examples, then in LAN to get data from the database, you need to refer to the module method, which, in turn, refers to the mapper and caches the received data after performing the necessary manipulations with them. Visual examples of mappers, as well as the entire chain of necessary calls, can be easily traced in the source code of ls:
https://github.com/livestreet/livestreet/blob/master/application/classes/actions/ActionIndex.class.php#L296
https:/ /github.com/livestreet/livestreet/blob/master/application/classes/modules/topic/Topic.class.php#L597
https://github.com/livestreet/livestreet/blob/master/application/classes/modules/ topic/Topic.class.php#L531
https://github.com/livestreet/livestreet/blob/master/application/classes/modules/topic/mapper/Topic.mapper.class.php#L190-L230

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question