FindByField

Navigation:  Development > Function Reference > InformationSet >

FindByField

Previous pageReturn to chapter overviewNext page

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

App::InformationSet(NAME)->findBy[Field](VALUE);
 

 
We can pass condition of WHERE clause as parameter of the function.

 

For example: 
 
$data = App::InformationSet('blogpost')->findByCategory(2);
 
// Return value
/*
Array
(
    [id] => 1
    [adminref] => 1
    [entrydate] => 2012-12-12 22:23:41
    [lastmodified] => 2012-12-14 00:13:02
    [title] => How to install Application
    [category] => 2
    [description] => Application is one of the easiest solutions to incorporate new features. 
    [status] => Public
)*/