forked from aslan/applicant-site
77 lines
2.0 KiB
PHP
77 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Helpers;
|
|
|
|
use App\Models\Direction;
|
|
use App\Models\DirectionProfile;
|
|
use App\Models\Document;
|
|
use App\Models\EntranceExamination;
|
|
use App\Models\ExaminationType;
|
|
use App\Models\Faculty;
|
|
use App\Models\EducationalInstitution;
|
|
use App\Models\SubjectType;
|
|
use App\Models\Subject;
|
|
|
|
class PositionHelper
|
|
{
|
|
public static function faculty()
|
|
{
|
|
$maxPosition = Faculty::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function direction()
|
|
{
|
|
$maxPosition = Direction::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function educationalInstitution()
|
|
{
|
|
$maxPosition = EducationalInstitution::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function directionProfile()
|
|
{
|
|
$maxPosition = DirectionProfile::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function subjectType()
|
|
{
|
|
$maxPosition = SubjectType::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function subject()
|
|
{
|
|
$maxPosition = Subject::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function examinationType()
|
|
{
|
|
$maxPosition = ExaminationType::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function entranceExamination()
|
|
{
|
|
$maxPosition = EntranceExamination::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function department()
|
|
{
|
|
$maxPosition = EntranceExamination::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
|
|
public static function document()
|
|
{
|
|
$maxPosition = Document::max('position');
|
|
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
|
}
|
|
}
|