| 1 | package OpenERP::OOM::Tutorial::Searching; | ||
| 2 | |||
| 3 | # FIXME: should this be a pod file instead? | ||
| 4 | |||
| 5 | =pod | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | OpenERP::OOM::Tutorial::Searching | ||
| 10 | |||
| 11 | =head1 DESCRIPTION | ||
| 12 | |||
| 13 | =head1 Complex Search Terms | ||
| 14 | |||
| 15 | OpenERP allows logic operators like most database wrappers, just | ||
| 16 | a little stranger. It uses postfix style operators to allow you | ||
| 17 | to or things together. You can also use '&' as an operator. | ||
| 18 | |||
| 19 | my $products = $schema->class('Product'); | ||
| 20 | $products->search('|', '|', | ||
| 21 | [ 'default_code', 'ilike', '%' . $query . '%' ], | ||
| 22 | [ 'description', 'ilike', '%' . $query . '%' ], | ||
| 23 | [ 'name', 'ilike', '%' . $query . '%' ]); | ||
| 24 | |||
| 25 | For more details see the OpenERP Developer book. | ||
| 26 | |||
| 27 | =head2 AUTHOR | ||
| 28 | |||
| 29 | Colin Newell <colin@opusvl.com> | ||
| 30 | |||
| 31 | =head1 COPYRIGHT & LICENSE | ||
| 32 | |||
| 33 | Copyright (C) 2012 OpusVL | ||
| 34 | |||
| 35 | This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||
| 36 | |||
| 37 | =cut | ||
| 38 | |||
| 39 | 1 | 1; |