Query Models and make a list

12 views
Skip to first unread message

مصطفی برمشوری

unread,
Nov 11, 2011, 3:51:40 AM11/11/11
to pluf-...@googlegroups.com
Imagine there is a model (for example its name is Message). is it possible to query the model and generate a Message list.

For example Message model is:

        //The table in the database where your
        //model is stored.
        $this->_a['table'] = 'niaz_message';
       
        // The name of your model
        $this->_a['model'] = 'Niaz_Message';
       
        // Here the core with the definition of the
        // fields.
        $modelid = array();
        $modelid['type'] = 'Pluf_DB_Field_Sequence';
        $modelid['blank'] = true;
       
        $modeltitle = array();
        $modeltitle['type'] = 'Pluf_DB_Field_Varchar';
        $modeltitle['blank'] = true;
        $modeltitle['size'] = 200;
       
        $modeltext = array();
        $modeltext['type'] = 'Pluf_DB_Field_Text';
        $modeltext['blank'] = true;

        $cols = array();
        $cols['id'] = $modelid;
        $cols['title'] = $modeltitle;
        $cols['text'] = $modeltext;
       
        $this->_a['cols'] = $cols;

and the question is how to list all message from date1 to date2.

maso

unread,
Nov 14, 2011, 5:40:52 PM11/14/11
to Pluf Users
I could not find any way.

maso

unread,
Nov 14, 2011, 6:38:38 PM11/14/11
to Pluf Users


On Nov 15, 1:40 am, maso <mostafa.barmsh...@gmail.com> wrote:
> I could not find any way.
here is a simple doc to query data base but it is too hard to
undrstand it.

maso

unread,
Nov 15, 2011, 8:37:54 AM11/15/11
to Pluf Users
It is possible to define new view. Each view in Pluf_Model is the
same as SQL Query. here is a little documentation about it:

http://www.pluf.org/doc/advanced-orm.html

but it is not clear for me?! Is there any body to help me?
Reply all
Reply to author
Forward
0 new messages