| @@ 75-89 (lines=15) @@ | ||
| 72 | * @param $relationName | |
| 73 | * @param array $arguments | |
| 74 | */ | |
| 75 | public function __construct($relationName, $arguments = []) | |
| 76 |     { | |
| 77 | $this->relationName = $relationName; | |
| 78 | ||
| 79 | $this->column = $relationName; | |
| 80 | ||
| 81 |         if (count($arguments) == 1) { | |
| 82 | $this->label = $this->formatLabel(); | |
| 83 | $this->builder = $arguments[0]; | |
| 84 | } | |
| 85 | ||
| 86 |         if (count($arguments) == 2) { | |
| 87 | list($this->label, $this->builder) = $arguments; | |
| 88 | } | |
| 89 | } | |
| 90 | ||
| 91 | /** | |
| 92 | * Get validator for this field. | |
| @@ 24-36 (lines=13) @@ | ||
| 21 | * @param string $column | |
| 22 | * @param array $arguments | |
| 23 | */ | |
| 24 | public function __construct($column, $arguments = []) | |
| 25 |     { | |
| 26 | $this->column = $column; | |
| 27 | ||
| 28 |         if (count($arguments) == 1) { | |
| 29 | $this->label = $this->formatLabel(); | |
| 30 | $this->builder = $arguments[0]; | |
| 31 | } | |
| 32 | ||
| 33 |         if (count($arguments) == 2) { | |
| 34 | list($this->label, $this->builder) = $arguments; | |
| 35 | } | |
| 36 | } | |
| 37 | ||
| 38 | /** | |
| 39 | * Prepare input data for insert or update. | |