Skip to content

Commit

Permalink
Changes to files: app/Models/Building.php
Browse files Browse the repository at this point in the history
app/Models/BuildingUnitSetup.php
app/Models/Estate.php
app/Models/ReadingElectricity.php
app/Models/ReadingGas.php
app/Models/ReadingWater.php
app/Models/Region.php
app/Models/Tenancy.php
app/Models/TenancyInvoice.php
app/Models/TenancyService.php
app/Models/Town.php
app/Models/Unit.php
app/Models/UnitSetup.php
  • Loading branch information
dedanirungu committed Sep 5, 2024
1 parent 58ba433 commit 9831646
Show file tree
Hide file tree
Showing 13 changed files with 190 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/Models/Building.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Realestate\Models;

use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Estate;

class Building extends BaseModel
{
Expand All @@ -20,4 +21,13 @@ class Building extends BaseModel
*/
protected $table = "realestate_building";

/**
* Add relationship to Estate
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function estate()
{
return $this->belongsTo(Estate::class);
}

}
10 changes: 10 additions & 0 deletions app/Models/BuildingUnitSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Realestate\Models;

use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Building;

class BuildingUnitSetup extends BaseModel
{
Expand All @@ -20,4 +21,13 @@ class BuildingUnitSetup extends BaseModel
*/
protected $table = "realestate_building_unit_setup";

/**
* Add relationship to Building
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function building()
{
return $this->belongsTo(Building::class);
}

}
10 changes: 10 additions & 0 deletions app/Models/Estate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Realestate\Models;

use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Town;

class Estate extends BaseModel
{
Expand All @@ -20,4 +21,13 @@ class Estate extends BaseModel
*/
protected $table = "realestate_estate";

/**
* Add relationship to Town
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function town()
{
return $this->belongsTo(Town::class);
}

}
20 changes: 20 additions & 0 deletions app/Models/ReadingElectricity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Modules\Realestate\Models;

use Modules\Account\Models\Invoice;
use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Tenancy;

class ReadingElectricity extends BaseModel
{
Expand All @@ -21,4 +23,22 @@ class ReadingElectricity extends BaseModel
*/
protected $table = "realestate_reading_electricity";

/**
* Add relationship to Tenancy
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function tenancy()
{
return $this->belongsTo(Tenancy::class);
}

/**
* Add relationship to Invoice
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function invoice()
{
return $this->belongsTo(Invoice::class);
}

}
20 changes: 20 additions & 0 deletions app/Models/ReadingGas.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Modules\Realestate\Models;

use Modules\Account\Models\Invoice;
use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Tenancy;

class ReadingGas extends BaseModel
{
Expand All @@ -20,4 +22,22 @@ class ReadingGas extends BaseModel
*/
protected $table = "realestate_reading_gas";

/**
* Add relationship to Tenancy
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function tenancy()
{
return $this->belongsTo(Tenancy::class);
}

/**
* Add relationship to Invoice
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function invoice()
{
return $this->belongsTo(Invoice::class);
}

}
20 changes: 20 additions & 0 deletions app/Models/ReadingWater.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Modules\Realestate\Models;

use Modules\Account\Models\Invoice;
use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Tenancy;

class ReadingWater extends BaseModel
{
Expand All @@ -20,4 +22,22 @@ class ReadingWater extends BaseModel
*/
protected $table = "realestate_reading_water";

/**
* Add relationship to Tenancy
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function tenancy()
{
return $this->belongsTo(Tenancy::class);
}

/**
* Add relationship to Invoice
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function invoice()
{
return $this->belongsTo(Invoice::class);
}

}
20 changes: 20 additions & 0 deletions app/Models/Region.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Modules\Realestate\Models;

use Modules\Base\Models\BaseModel;
use Modules\Core\Models\Country;
use Modules\Realestate\Models\State;

class Region extends BaseModel
{
Expand All @@ -20,4 +22,22 @@ class Region extends BaseModel
*/
protected $table = "realestate_region";

/**
* Add relationship to Country
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function country()
{
return $this->belongsTo(Country::class);
}

/**
* Add relationship to State
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function state()
{
return $this->belongsTo(State::class);
}

}
20 changes: 20 additions & 0 deletions app/Models/Tenancy.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Modules\Realestate\Models;

use Modules\Base\Models\BaseModel;
use Modules\Partner\Models\Partner;
use Modules\Realestate\Models\Unit;

class Tenancy extends BaseModel
{
Expand All @@ -20,4 +22,22 @@ class Tenancy extends BaseModel
*/
protected $table = "realestate_tenancy";

/**
* Add relationship to Unit
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function unit()
{
return $this->belongsTo(Unit::class);
}

/**
* Add relationship to Partner
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function partner()
{
return $this->belongsTo(Partner::class);
}

}
20 changes: 20 additions & 0 deletions app/Models/TenancyInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Modules\Realestate\Models;

use Modules\Account\Models\Invoice;
use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Tenancy;

class TenancyInvoice extends BaseModel
{
Expand All @@ -20,4 +22,22 @@ class TenancyInvoice extends BaseModel
*/
protected $table = "realestate_tenancy_invoice";

/**
* Add relationship to Tenancy
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function tenancy()
{
return $this->belongsTo(Tenancy::class);
}

/**
* Add relationship to Invoice
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function invoice()
{
return $this->belongsTo(Invoice::class);
}

}
10 changes: 10 additions & 0 deletions app/Models/TenancyService.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Realestate\Models;

use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Tenancy;

class TenancyService extends BaseModel
{
Expand All @@ -20,4 +21,13 @@ class TenancyService extends BaseModel
*/
protected $table = "realestate_tenancy_service";

/**
* Add relationship to Tenancy
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function tenancy()
{
return $this->belongsTo(Tenancy::class);
}

}
10 changes: 10 additions & 0 deletions app/Models/Town.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Realestate\Models;

use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Region;

class Town extends BaseModel
{
Expand All @@ -20,4 +21,13 @@ class Town extends BaseModel
*/
protected $table = "realestate_town";

/**
* Add relationship to Region
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function region()
{
return $this->belongsTo(Region::class);
}

}
10 changes: 10 additions & 0 deletions app/Models/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Realestate\Models;

use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Building;

class Unit extends BaseModel
{
Expand All @@ -20,4 +21,13 @@ class Unit extends BaseModel
*/
protected $table = "realestate_unit";

/**
* Add relationship to Building
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function building()
{
return $this->belongsTo(Building::class);
}

}
10 changes: 10 additions & 0 deletions app/Models/UnitSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Modules\Realestate\Models;

use Modules\Base\Models\BaseModel;
use Modules\Realestate\Models\Unit;

class UnitSetup extends BaseModel
{
Expand All @@ -20,4 +21,13 @@ class UnitSetup extends BaseModel
*/
protected $table = "realestate_unit_setup";

/**
* Add relationship to Unit
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function unit()
{
return $this->belongsTo(Unit::class);
}

}

0 comments on commit 9831646

Please sign in to comment.