Conversie codeigniter 4

This commit is contained in:
2026-01-09 11:41:28 +01:00
parent dbd8c8aed2
commit f0b9c6ad40
242 changed files with 20034 additions and 346 deletions
+47
View File
@@ -0,0 +1,47 @@
<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 23/01/2018
* Time: 11:37
*/
class Projectcost extends BaseModel {
public function project()
{
return $this->belongsTo( 'Project' );
}
public function external()
{
return $this->belongsTo( 'External' );
}
public static function saveProjectcost( $projectID, $project )
{
$project = (array) $project;
if ( $projectID == 0 )
{
$project = Self::create( $project );
$projectID = $project['id'];
}
else
{
Self::whereId( $projectID )->update( $project );
}
return $projectID;
}
public static function getCostsPerPerProject( $projectID )
{
$projectCosts = Projectcost::selectraw( 'ROUND(COALESCE(SUM(costs), 0), 0) AS costs')
->whereProjectId($projectID)
->first();
return $projectCosts->costs;
}
}