| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace App\Http\Livewire\Traits;
- trait HasPasseggero{
- public function editPasseggero($x) {
- if (!in_array($x, [1, 2, 3, 4])) {
- return;
- }
- $this->currentPasseggero = $x;
- $propertyName = 'data_passeggero_' . ($x - 1);
- if (property_exists($this, $propertyName)) {
- $this->editAnagrafica($this->{$propertyName});
- $this->emit('load-anagrafica-modal');
- }
- }
- public function removePasseggero($x){
- if (!in_array($x, [1, 2, 3, 4])) {
- return;
- }
- $propertyName = 'data_passeggero_' . ($x - 1);
- if (property_exists($this, $propertyName)) {
- $this->{$propertyName} = 0;
- $this->emit('add-default-value', 0, '', $propertyName);
- }
- }
- public function addPasseggero($x){
- $this->resetAnagrafica();
- $this->currentPasseggero = $x;
- $this->emit('load-anagrafica-modal');
- }
- }
|