<?php

namespace App\Geo\Postal\Classes;

use ORM\Entity as Entity;
use App\Geo\City\Classes\City as City;
use App\Geo\Zone\Classes\Zone as Zone;
use App\Geo\State\Classes\State as State;
use App\Geo\Country\Classes\Country as Country;

class Postal extends Entity {

    //const _idPolice = Array("type" => "", "min" => 0, "max" => 100000, "step" => 2);

    const _tableName = "geo_postals";

    /* const _properties = Array(
      "id"   => ['listable' => true,  'searcheble' => false, 'orderable' => false],
      "name" => ['listable' => true,  'searcheble' => true]);
     */

    //const _timestamps = true;
    //const _softdelete = true;
    //const _connectionName = "";

    public function country() {
        return $this->belongsTo(Country::class, 'country_id', 'id', $this);
    }

    public function state() {
        return $this->belongsTo(State::class, 'state_id', 'id', $this);
    }

    public function city() {
        return $this->belongsTo(City::class, 'city_id', 'id', $this);
    }

    public function zone() {
        return $this->belongsTo(Zone::class, 'zone_id', 'id', $this);
    }

}
