| @@ 23-35 (lines=13) @@ | ||
| 20 | * @param string $column | |
| 21 | * @param array $arguments | |
| 22 | */ | |
| 23 | public function __construct($column, $arguments = []) | |
| 24 |     { | |
| 25 | $this->column = $column; | |
| 26 | ||
| 27 |         if (count($arguments) == 1) { | |
| 28 | $this->label = $this->formatLabel(); | |
| 29 | $this->builder = $arguments[0]; | |
| 30 | } | |
| 31 | ||
| 32 |         if (count($arguments) == 2) { | |
| 33 | list($this->label, $this->builder) = $arguments; | |
| 34 | } | |
| 35 | } | |
| 36 | ||
| 37 | /** | |
| 38 | * Prepare input data for insert or update. | |
| @@ 65-79 (lines=15) @@ | ||
| 62 | * @param $relationName | |
| 63 | * @param array $arguments | |
| 64 | */ | |
| 65 | public function __construct($relationName, $arguments = []) | |
| 66 |     { | |
| 67 | $this->relationName = $relationName; | |
| 68 | ||
| 69 | $this->column = $relationName; | |
| 70 | ||
| 71 |         if (count($arguments) == 1) { | |
| 72 | $this->label = $this->formatLabel(); | |
| 73 | $this->builder = $arguments[0]; | |
| 74 | } | |
| 75 | ||
| 76 |         if (count($arguments) == 2) { | |
| 77 | list($this->label, $this->builder) = $arguments; | |
| 78 | } | |
| 79 | } | |
| 80 | ||
| 81 | /** | |
| 82 | * Get validator for this field. | |