Files
dbois/application/models/eloquent/Projecthour.php
T
2018-01-23 08:45:44 +01:00

41 lines
860 B
PHP

<?php
/**
* Created by Pensare Software.
* User: Theo Weijmer
* Date: 19/01/2018
* Time: 15:51
*/
class Projecthour extends BaseModel {
protected $table = "projecthours";
public function projectemployee()
{
$this->belongsTo( 'Projectemployee' );
}
public static function saveProjecthour( $projecthourID, $projecthour )
{
$projecthour = (array) $projecthour;
if ( $projecthourID == 0 )
{
$projecthour = Projecthour::create( $projecthour );
$projecthourID = $projecthour['id'];
}
else
{
Projecthour::whereId( $projecthourID )->update( $projecthour );
}
return $projecthourID;
}
public static function removeProjecthour( $projecthourID )
{
Projecthour::whereId( $projecthourID )->delete();
}
}