find

Navigation:  Development > Function Reference > CategorySet >

find

Previous pageReturn to chapter overviewNext page

This function fetch a singe row from a table. See below format
 

App::CategorySet(NAME)->find(CONDITION);
 

 
If we use just find() then it return a singe entry of table following default insert sequence. Also we can pass condition of WHERE clause as parameter of the function.

 

For example: 
$data = App::CategorySet('blog-cat')->find(); 
$data = App::CategorySet('blog-cat')->find("1 ORDER BY id ASC");
 
// Return value
/*

Array

(

    [id] => 1

    [fkey] => 0

    [adminref] => 1

    [parentid] => 0

    [image] => app.jpg

    [title] => Application

    [description] => Application is one of the easiest solutions to incorporate new features

    [type] => blog-cat

    [generic] => 10

    [entrydate] => 2012-12-13 10:47:18

    [lastmodified] => 2012-12-13 10:47:18

)

*/