Postal.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Geo\Postal\Classes;
  3. use ORM\Entity as Entity;
  4. use App\Geo\City\Classes\City as City;
  5. use App\Geo\Zone\Classes\Zone as Zone;
  6. use App\Geo\State\Classes\State as State;
  7. use App\Geo\Country\Classes\Country as Country;
  8. class Postal extends Entity {
  9. //const _idPolice = Array("type" => "", "min" => 0, "max" => 100000, "step" => 2);
  10. const _tableName = "geo_postals";
  11. /* const _properties = Array(
  12. "id" => ['listable' => true, 'searcheble' => false, 'orderable' => false],
  13. "name" => ['listable' => true, 'searcheble' => true]);
  14. */
  15. //const _timestamps = true;
  16. //const _softdelete = true;
  17. //const _connectionName = "";
  18. public function country() {
  19. return $this->belongsTo(Country::class, 'country_id', 'id', $this);
  20. }
  21. public function state() {
  22. return $this->belongsTo(State::class, 'state_id', 'id', $this);
  23. }
  24. public function city() {
  25. return $this->belongsTo(City::class, 'city_id', 'id', $this);
  26. }
  27. public function zone() {
  28. return $this->belongsTo(Zone::class, 'zone_id', 'id', $this);
  29. }
  30. }