advanced.data-provider.txt 725 B

123456789101112131415161718192021222324252627
  1. Title: Data Provider Object
  2. ShortTitle: Data Provider
  3. Author: Dariusz Górecki <darek.krk@gmail.com>
  4. ---
  5. ~~~
  6. [php]
  7. // basic dataprovider returns whole collection (with efficient pagination support out-of-box)
  8. $dp = new EMongoDocumentDataProvider('modelClassNameOrInstance');
  9. // data provider with query
  10. $dp = new EMongoDocumentDataProvider('modelClassNameOrInstance', array(
  11. 'conditions'=>/* query array goes here */
  12. ));
  13. // data provider, enable sorting (needs to be set explicit)
  14. $dp = new EMongoDocumentDataProvider('modelClassNameOrInstance', array(
  15. /* standard config array */
  16. 'conditions'=>array(/* query array goes here */)
  17. 'sort'=>array(
  18. 'attributes'=>array(
  19. // list of sortable attributes
  20. )
  21. ),
  22. ));
  23. ~~~