| Conditions | 4 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.016 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | 16 | public function fromModel($model, DocumentPropertyMeta $fieldMeta) |
|
| 39 | { |
||
| 40 | 16 | $name = $fieldMeta->name; |
|
| 41 | // Create Manganel meta instance of field |
||
| 42 | 16 | $meta = ManganelMeta::create($model)->field($name); |
|
| 43 | |||
| 44 | // Skip if explicitly not searchable |
||
| 45 | 16 | if (false === $meta->searchable) |
|
| 46 | { |
||
| 47 | 3 | return false; |
|
| 48 | } |
||
| 49 | |||
| 50 | // Skip non-persistent fields |
||
| 51 | 16 | if (false === $meta->persistent) |
|
| 52 | { |
||
| 53 | return false; |
||
| 54 | } |
||
| 55 | |||
| 56 | // Skip secret fields |
||
| 57 | 16 | if ($meta->secret) |
|
| 58 | { |
||
| 59 | 3 | return false; |
|
| 60 | } |
||
| 61 | 15 | return true; |
|
| 62 | } |
||
| 63 | |||
| 70 |