Micro-ORM/app/Model/Job.php

22 lines
528 B
PHP
Raw Normal View History

2021-02-27 23:04:16 +00:00
<?php
namespace App\Model;
use App\Query\IJobQuery;
use App\Query\JobQuery;
use Fufle\ORM\Model as BaseModel;
2021-02-28 00:04:44 +00:00
class Job extends BaseModel {
2021-02-27 23:04:16 +00:00
//private string $table = 'jobs';
2021-02-27 23:50:37 +00:00
//protected static ?IJobQuery $query;
2021-02-27 23:04:16 +00:00
public int $id;
public float $budget;
public static function Initialize() {
2021-02-27 23:53:32 +00:00
if (static::$query === null) {
2021-02-28 00:01:37 +00:00
static::$query = new JobQuery(self::class);
2021-02-27 23:04:16 +00:00
}
}
public static function GetLast10() {
return self::QueryAll(self::$query->GetLast10());
}
}