Commit 17659b7c authored by Abraão Barbosa's avatar Abraão Barbosa
Browse files
parents 38f8b481 618e573b
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Disciplina extends Model
{
use HasFactory;
/**
* References table disciplinas
*
* @var string
*/
protected $table = 'disciplinas';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name', 'curso_id'];
/**
* Get Curso with curso.id = disciplinas.curso_id
*
* @return Curso
*/
public function curso()
{
return $this->belongsTo(Curso::class);
}
/**
* @return string
*/
public function __toString()
{
return $this->name;
}
}
...@@ -32,6 +32,10 @@ class EnsinoAula extends Model ...@@ -32,6 +32,10 @@ class EnsinoAula extends Model
protected $fillable = ['cod_atividade', 'componente_curricular', 'curso_id', 'nivel', 'modalidade', 'ch_semanal', 'ch_total', 'pad_id']; protected $fillable = ['cod_atividade', 'componente_curricular', 'curso_id', 'nivel', 'modalidade', 'ch_semanal', 'ch_total', 'pad_id'];
/**
* cod_dimensao from planejamento table
* @var array
*/
private $codesDimensao = ['E-1', 'E-2', 'E-3']; private $codesDimensao = ['E-1', 'E-2', 'E-3'];
...@@ -67,13 +71,13 @@ class EnsinoAula extends Model ...@@ -67,13 +71,13 @@ class EnsinoAula extends Model
*/ */
public function orientacaoPreenchimento() { public function orientacaoPreenchimento() {
return [ return [
'descricao' => 'Ensino (Aulas em componentes curriculares)', 'descricao' => ['item' => '1.', 'descricao' => 'Ensino (Aulas em componentes curriculares)'],
'componente_curricular' => 'Nome do Componente: Nome do componente curricular como descrito no PPC do curso', 'componente_curricular' => ['item' => 'Nome do Componente:', 'descricao' => 'Nome do componente curricular como descrito no PPC do curso'],
'curso' => 'Curso: Nome do curso ao qual o componente curricular pertence', 'curso' => ['item' => 'Curso:', 'descricao' => 'Nome do curso ao qual o componente curricular pertence'],
'nivel' => 'Nível: Preencher o nível do curso ao qual o componente curricular pertence, sendo as opções: Graduação, Pós-graduação Stricto Sensu, Pós-Graduação Lato Sensu', 'nivel' => ['item' => 'Nível:', 'descricao' => 'Preencher o nível do curso ao qual o componente curricular pertence, sendo as opções: Graduação, Pós-graduação Stricto Sensu, Pós-Graduação Lato Sensu'],
'modalidade' => 'Modalidade: Preencher a modalidade que o componente curricular é ofertado, sendo as opções: Presencial e EAD', 'modalidade' => ['item' => 'Modalidade:', 'descricao' => 'Preencher a modalidade que o componente curricular é ofertado, sendo as opções: Presencial e EAD'],
'ch_semanal' => 'Carga Horária Semanal: Carga horária total efetiva exercida pelo docente dentro do componente curricular dividida pelo número de semanas que o mesmo ocorre', 'ch_semanal' => ['item' => 'Carga Horária Semanal:', 'descricao' => 'Carga horária total efetiva exercida pelo docente dentro do componente curricular dividida pelo número de semanas que o mesmo ocorre'],
'ch_total' => 'Carga Horária Total: Carga horária total efetiva exercida pelo docente dentro do(s) componente(s) curricular (es)', 'ch_total' => ['item' => 'Carga Horária Total:', 'descricao' => 'Carga horária total efetiva exercida pelo docente dentro do(s) componente(s) curricular (es)'],
]; ];
} }
......
<?php
namespace App\Models\Tabelas\Ensino;
use App\Queries\PlanejamentoQuery;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class EnsinoCoordenacao extends Model
{
use HasFactory;
const NIVEL_GRADUACAO = 1;
const NIVEL_POS_GRADUACAO_LATO_SENSU = 2;
const NIVEL_POS_GRADUACAO_STRICTO_SENSU = 3;
const MODALIDADE_EAD = 1;
const MODALIDADE_PRESENCIAL = 2;
/**
* References table ensino_coordenacao
*
* @var string
*/
protected $table = 'ensino_coordenacao';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['cod_atividade', 'componente_curricular', 'curso_id', 'nivel', 'modalidade', 'ch_semanal', 'pad_id'];
/**
* cod_dimensao from planejamento table
* @var array
*/
private $codesDimensao = ['E-14'];
/**
* @return array|string
*/
public function listNivel($value = null) {
$values = [
self::NIVEL_GRADUACAO => 'Graduação',
self::NIVEL_POS_GRADUACAO_LATO_SENSU => 'Pós-graduação Stricto Sensu',
self::NIVEL_POS_GRADUACAO_STRICTO_SENSU => 'Pós-Graduação Lato Sensu',
];
return $value !== null? $values[$value] : $values;
}
/**
* @return array|string
*/
public function listModalidade($value = null) {
$values = [
self::MODALIDADE_EAD => 'EAD',
self::MODALIDADE_PRESENCIAL => 'Presencial',
];
return $value !== null? $values[$value] : $values;
}
/**
* @return array
*/
public function orientacaoPreenchimento() {
return [
'descricao' => ['item' => '2.', 'ENSINO (COORDENAÇÃO/ REGÊNCIA COMPONENTES CURRICULARES)'],
'componente_curricular' => ['item' => 'Nome do Componente:', 'descricao' => 'Nome do componente curricular como descrito no PPC do curso'],
'curso' => ['item' => 'Curso:', 'descricao' => 'Nome do curso ao qual o componente curricular pertence'],
'nivel' => ['item' => 'Nível:', 'descricao' => 'Preencher o nível do curso ao qual o componente curricular pertence, sendo as opções: Graduação, Pós-graduação Stricto Sensu, Pós-Graduação Lato Sensu'],
'modalidade' => ['item' => 'Modalidade:', 'descricao' => 'Preencher a modalidade que o componente curricular é ofertado, sendo as opções: Presencial e EAD'],
'ch_semanal' => ['item' => 'Carga Horária Semanal:', 'descricao' => 'Carga horária semanal efetivamente exercida na atividade (preencher de acordo com quadro de referência)'],
];
}
/**
* Get PAD with pad.id = ensino_coordenacao.pad_id
*
* @return PAD
*/
public function pad() {
return $this->belongsTo(PAD::class);
}
/**
* Get Curso with curso.id = ensino_aulas.curso_id
*
* @return Curso
*/
public function curso()
{
return $this->belongsTo(Curso::class);
}
/**
* @return array
*/
public function getPlanejamentos() {
$query = new PlanejamentoQuery();
return $query->whereInCodDimensao($this->codesDimensao)->get();
}
}
<?php
namespace App\Models\Tabelas\Ensino;
use App\Queries\PlanejamentoQuery;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class EnsinoOrientacao extends Model
{
use HasFactory;
const NIVEL_GRADUACAO = 1;
const NIVEL_POS_GRADUACAO_LATO_SENSU = 2;
const NIVEL_POS_GRADUACAO_STRICTO_SENSU = 3;
const MODALIDADE_EAD = 1;
const MODALIDADE_PRESENCIAL = 2;
const ORIENTACAO_GRUPO = 1;
const ORIENTACAO_INDIVIDUAL = 2;
/**
* References table ensino_orientacoes
*
* @var string
*/
protected $table = 'ensino_orientacoes';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['cod_atividade', 'atividade', 'curso_id', 'nivel', 'type_orientacao', 'numero_orientandos', 'ch_semanal', 'pad_id'];
/**
* cod_dimensao from planejamento table
* @var array
*/
private $codesDimensao = ['E-5', 'E-6', 'E-7', 'E-8', 'E-9'];
/**
* @return array|string
*/
public function listNivel($value = null) {
$values = [
self::NIVEL_GRADUACAO => 'Graduação',
self::NIVEL_POS_GRADUACAO_LATO_SENSU => 'Pós-graduação Stricto Sensu',
self::NIVEL_POS_GRADUACAO_STRICTO_SENSU => 'Pós-Graduação Lato Sensu',
];
return $value !== null? $values[$value] : $values;
}
/**
* @return array|string
*/
public function listModalidade($value = null) {
$values = [
self::MODALIDADE_EAD => 'EAD',
self::MODALIDADE_PRESENCIAL => 'Presencial',
];
return $value !== null? $values[$value] : $values;
}
/**
* @return array|string
*/
public function listTypeOrientacao($value = null) {
$values = [
self::ORIENTACAO_GRUPO => 'Individual',
self::ORIENTACAO_INDIVIDUAL => 'Grupo',
];
return $value !== null? $values[$value] : $values;
}
/**
* @return array
*/
public function orientacaoPreenchimento() {
return [
'descricao' => ['item' => '3.', 'ENSINO (ORIENTAÇÕES: ORIENTAÇÃO DE ESTÁGIO, ORIENTAÇÃO DE TCC, ORIENTAÇÃO DE RESIDÊNCIA, ORIENTAÇÃO DE MESTRADO E/OU ORIENTAÇÃO DE DOUTORADO. COORIENTAÇÕES: TCC, MESTRADO E/OU DOUTORADO)'],
'atividade' => ['item' => 'Atividade de Orientação e Coorientação:', 'descricao' => 'Nome do componente curricular como descrito no PPC do curso'],
'curso' => ['item' => 'Curso:', 'descricao' => 'Nome do curso ao qual o(s) discente(s) orientado(s) pertence'],
'nivel' => ['item' => 'Nível:', 'descricao' => 'Preencher o nível do curso que a orientação é realizada, sendo as opções: Graduação, Pós-graduação Stricto Sensu, Pós-Graduação Lato Sensu'],
'type_orientacao' => ['item' => 'Individual ou Grupo:', 'descricao' => 'Preencher se a orientação é individual ou em grupo. Caso seja em grupo, informar o número de participantes'],
'modalidade' => ['item' => 'Modalidade:', 'descricao' => 'Preencher a modalidade que o componente curricular é ofertado, sendo as opções: Presencial e EAD'],
'ch_semanal' => ['item' => 'Carga Horária Semanal:', 'descricao' => 'Carga horária semanal efetivamente exercida na atividade (preencher de acordo com quadro de referência)'],
];
}
/**
* Get PAD with pad.id = ensino_coordenacao.pad_id
*
* @return PAD
*/
public function pad() {
return $this->belongsTo(PAD::class);
}
/**
* Get Curso with curso.id = ensino_aulas.curso_id
*
* @return Curso
*/
public function curso()
{
return $this->belongsTo(Curso::class);
}
/**
* @return array
*/
public function getPlanejamentos() {
$query = new PlanejamentoQuery();
return $query->whereInCodDimensao($this->codesDimensao)->get();
}
}
...@@ -16,7 +16,8 @@ class PlanejamentoQuery extends Query { ...@@ -16,7 +16,8 @@ class PlanejamentoQuery extends Query {
* @return Builder * @return Builder
*/ */
public function whereDimensao(int $dimensao, string $expression = '=') { public function whereDimensao(int $dimensao, string $expression = '=') {
return $this->query->where('dimensao', $expression, $dimensao); $this->query = $this->query->where('dimensao', $expression, $dimensao);
return $this->query;
} }
/** /**
...@@ -25,7 +26,8 @@ class PlanejamentoQuery extends Query { ...@@ -25,7 +26,8 @@ class PlanejamentoQuery extends Query {
* @return Builder * @return Builder
*/ */
public function whereCodDimensao(string $cod_dimensao, string $expression = '=') { public function whereCodDimensao(string $cod_dimensao, string $expression = '=') {
return $this->query->where('cod_dimensao', $expression, $cod_dimensao); $this->query = $this->query->where('cod_dimensao', $expression, $cod_dimensao);
return $this->query;
} }
/** /**
...@@ -34,7 +36,8 @@ class PlanejamentoQuery extends Query { ...@@ -34,7 +36,8 @@ class PlanejamentoQuery extends Query {
* @return Builder * @return Builder
*/ */
public function whereInCodDimensao($codes_dimensao) { public function whereInCodDimensao($codes_dimensao) {
return $this->query->whereIn('cod_dimensao', $codes_dimensao); $this->query = $this->query->whereIn('cod_dimensao', $codes_dimensao);
return $this->query;
} }
} }
\ No newline at end of file
...@@ -22,7 +22,7 @@ class CreateEnsinoAulasTable extends Migration ...@@ -22,7 +22,7 @@ class CreateEnsinoAulasTable extends Migration
$table->tinyInteger('modalidade')->notNull(); $table->tinyInteger('modalidade')->notNull();
$table->integer('ch_semanal')->notNull(); $table->integer('ch_semanal')->notNull();
$table->integer('ch_total')->notNull(); $table->integer('ch_total')->notNull();
$table->foreignId('pad_id'); $table->foreignId('pad_id')->notNull();
$table->timestamps(); $table->timestamps();
}); });
} }
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateEnsinoCoordenacaoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ensino_coordenacao', function (Blueprint $table) {
$table->id();
$table->string('cod_atividade')->notNull();
$table->string('componente_curricular')->notNull();
$table->foreignId('curso_id')->notNull();
$table->tinyInteger('nivel')->notNull();
$table->tinyInteger('modalidade')->notNull();
$table->integer('ch_semanal')->notNull();
$table->foreignId('pad_id')->notNull();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('ensino_coordenacao');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateEnsinoOrientacoesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ensino_orientacoes', function (Blueprint $table) {
$table->id();
$table->string('cod_atividade')->notNull();
$table->string('atividade')->notNull();
$table->foreignId('curso_id')->notNull();
$table->tinyInteger('nivel')->notNull();
$table->tinyInteger('type_orientacao')->notNull();
$table->tinyInteger('numero_orientandos')->nullable();
$table->integer('ch_semanal')->notNull();
$table->foreignId('pad_id')->notNull();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('ensino_orientacoes');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDisciplinasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('disciplinas', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->foreignId('curso_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('disciplinas');
}
}
...@@ -22,7 +22,8 @@ class DatabaseSeeder extends Seeder ...@@ -22,7 +22,8 @@ class DatabaseSeeder extends Seeder
CursoSeeder::class, CursoSeeder::class,
UserSeeder::class, UserSeeder::class,
PlanejamentoSeeder::class, PlanejamentoSeeder::class,
PADSeeder::class PADSeeder::class,
DisciplinaSeeder::class,
]); ]);
} }
} }
<?php
namespace Database\Seeders;
use App\Models\Curso;
use App\Models\Disciplina;
use Illuminate\Database\Seeder;
class DisciplinaSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$cursos = Curso::all();
$disciplinas = ['Disciplina A', 'Disciplina B', 'Disciplina C', 'Disciplina D', 'Disciplina E'];
foreach($cursos as $curso) {
foreach($disciplinas as $disciplina) {
Disciplina::create([
'name' => $curso->name .' - '. $disciplina,
'curso_id' => $curso->id,
]);
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment