Merge pull request #4185 from samuelsov/CRM-15330
[civicrm-core.git] / CRM / Core / FileSearchInterface.php
1 <?php
2
3 interface CRM_Core_FileSearchInterface {
4 const DEFAULT_SEARCH_LIMIT = 20;
5 const DEFAULT_SEARCH_OFFSET = 0;
6
7 /**
8 * @param array $query
9 * Any of the following:.
10 * - text: string, plain text to search for
11 * - parent_table: string - entity to which file is directly attached
12 * - parent_id: int - entity to which file is directly attached
13 * - xparent_table: string - business-entity to which file is attached (directly or indirectly)
14 * - xparent_id: int - business-entity to which file is attached (directly or indirectly)
15 * @param int $limit
16 * @param int $offset
17 * @return array
18 * each item has keys:
19 * - file_id: int
20 * - parent_table: string - entity to which file is directly attached
21 * - parent_id: int - entity to which file is directly attached
22 * - xparent_table: string - business-entity to which file is attached (directly or indirectly)
23 * - xparent_id: int - business-entity to which file is attached (directly or indirectly)
24 */
25 public function search($query, $limit = self::DEFAULT_SEARCH_LIMIT, $offset = self::DEFAULT_SEARCH_OFFSET);
26
27 }