findAllByField

Navigation:  Development > Function Reference > InformationSet >

findAllByField

Previous pageReturn to chapter overviewNext page

This is a type of findAll method but here we can apply condition by Magic Method. See bellow format
 
App::InformationSet(NAME)->findAllBy[Field]([Value]);
 

Return multiple entry from the table.

 
Here [Field] is any database field of table, [Value] is a data that we want to apply in the query.
 
For example:
 
$data = App::InformationSet('blogpost')->findAllByCategory(2);

 

// Return value 
/*

Array

(

    [data] => Array

        (

            [0] => 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

                )

 

        )

 

)

*/