-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #718 from portabilis/portabilis-patch-2020-07-10
[2.3] Portabilis patch 10/07/2020
- Loading branch information
Showing
27 changed files
with
713 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
namespace App\Models\Exporter; | ||
|
||
use App\Models\Exporter\Builders\StudentEloquentBuilder; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Query\Builder; | ||
use Illuminate\Support\Collection; | ||
|
||
class Stage extends Model | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $table = 'exporter_stages'; | ||
|
||
/** | ||
* @var Collection | ||
*/ | ||
protected $alias; | ||
|
||
/** | ||
* @param Builder $query | ||
* | ||
* @return StudentEloquentBuilder | ||
*/ | ||
public function newEloquentBuilder($query) | ||
{ | ||
return new StudentEloquentBuilder($query); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getExportedColumnsByGroup() | ||
{ | ||
return [ | ||
'Etapas' => [ | ||
'school_name' => 'Escola', | ||
'school_class' => 'Turma', | ||
'stage_name' => 'Tipo de etapa', | ||
'stage_number' => 'Etapa', | ||
'stage_start_date' => 'Data início', | ||
'stage_end_date' => 'Data fim', | ||
'stage_type' => 'Padrão/Turma', | ||
'posted_data' => 'Possui lançamentos' | ||
], | ||
]; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getLabel() | ||
{ | ||
return 'Calendário letivo'; | ||
} | ||
|
||
/** | ||
* @param string $column | ||
* | ||
* @return string | ||
*/ | ||
public function alias($column) | ||
{ | ||
if (empty($this->alias)) { | ||
$this->alias = collect($this->getExportedColumnsByGroup())->flatMap(function ($item) { | ||
return $item; | ||
}); | ||
} | ||
|
||
return $this->alias->get($column, $column); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.