"resources/views/git@sites.upe.br:walter.felipe/submeta.git" did not exist on "3b30c761c5c5e0b342efe542ddc4395645434e20"
Commit 983c2ceb authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

add model de Unidade

parent 22696224
......@@ -5,37 +5,30 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Unidade extends Model
{
const ARCOVERDE = 1;
const CARUARU = 2;
const GARANHUNS = 3;
const NAZARE_DA_MATA = 4;
const PALMARES = 5;
const PETROLINA = 6;
const RECIFE = 7;
const REGIAO_METROPOLITANA = 8;
const SALGUEIRO = 9;
const SERRA_TALHADA = 10;
{
/**
* @param integer $value
* @return array|string
* References table unidade
*
* @var string
*/
public static function listUnidades($value = null)
{
$values = [
self::ARCOVERDE => 'Arcoverde',
self::CARUARU => 'Caruaru',
self::GARANHUNS => 'Garanhuns',
self::NAZARE_DA_MATA => 'Nazaré da Mata',
self::PALMARES => 'Palmares',
self::PETROLINA => 'Petrolina',
self::RECIFE => 'Recife',
self::REGIAO_METROPOLITANA => 'Região Metropolitana',
self::SALGUEIRO => 'Salgueiro',
self::SERRA_TALHADA => 'Serra Talhada',
];
protected $table = "unidade";
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name'];
return $value != null? $values[$value] : $values;
/**
* @return string
*/
public function __toString()
{
return $this->name;
}
}
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