How to work with find syntax

2012-02-22 Thread heohni
Hi, I have a find statement which look like this: $results = $this-GObject-find('all', array( 'conditions' = array( 'anotherfield = 1' ), 'fields' = array(''), 'order' = 'myfield ASC', 'limit'

Re: How to work with find syntax

2012-02-22 Thread Stephen
Hello The syntax looks fine, you should place it in your GObject model (models/g_object.php) and wrap it in a function i.e. function myFindQuery($variable=false) { ... } If $variable == true etc you can include Order / Limit and if it's equal to false you could exclude it. Then in your

Re: How to work with find syntax

2012-02-22 Thread heohni
great link thanks!!! I solved it this way: I build an array with all my conditions $this-SearchConditions['conditions'][] = 'GObject.OBJ_INTERNET_UPLOAD = DATE_SUB(NOW(),INTERVAL 14 DAY)'; $this-SearchConditions['order'] = 'GObject.OBJ_INTERNET_UPLOAD ASC'; $this-SearchConditions['limit'] = '2';