1 | <?php |
||
8 | class Field |
||
9 | { |
||
10 | public $crudApi; |
||
11 | |||
12 | /** |
||
13 | * Field constructor. |
||
14 | * |
||
15 | * @param CrudApi $crudApi |
||
16 | */ |
||
17 | public function __construct(CrudApi $crudApi) |
||
21 | |||
22 | /** |
||
23 | * Determine if the field is an id field. |
||
24 | * |
||
25 | * @param $field |
||
26 | * |
||
27 | * @return bool |
||
28 | */ |
||
29 | public function isIdField($field) |
||
33 | |||
34 | /** |
||
35 | * Parse a relation field name into the relation name. |
||
36 | * |
||
37 | * @param string $field Field name |
||
38 | * |
||
39 | * @return string |
||
40 | */ |
||
41 | public function getRelatedField($field) |
||
46 | |||
47 | /** |
||
48 | * Retrieve the models primary field for display purposes. |
||
49 | * |
||
50 | * @param $item Model to retrieve primary field of. |
||
51 | * @param null|array $config CrudApi Configuration. |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getPrimaryField($item, $config = null) |
||
85 | } |
||
86 |