Micro-ORM/demo/Model/Job.php

21 lines
451 B
PHP
Raw Normal View History

2021-02-27 23:04:16 +00:00
<?php
2021-03-01 15:06:02 +00:00
namespace Fufle\Demo\Model;
2021-02-27 23:04:16 +00:00
2021-03-01 15:06:02 +00:00
use Fufle\Demo\Query\IJobQuery;
use Fufle\Demo\Query\JobQuery;
2021-02-27 23:04:16 +00:00
use Fufle\ORM\Model as BaseModel;
2021-03-07 10:17:21 +00:00
use Fufle\ORM\IQuery;
2021-02-27 23:04:16 +00:00
2021-02-28 00:04:44 +00:00
class Job extends BaseModel {
2021-02-27 23:04:16 +00:00
public int $id;
public float $budget;
2021-03-07 10:17:21 +00:00
public static function SetQueryModel(): IQuery {
2021-03-01 15:06:02 +00:00
return new JobQuery( static::class );
2021-02-27 23:04:16 +00:00
}
2021-03-01 15:06:02 +00:00
2021-02-27 23:04:16 +00:00
public static function GetLast10() {
2021-03-01 15:06:02 +00:00
return self::QueryAll(self::QueryModel()->GetLast10());
2021-02-27 23:04:16 +00:00
}
2021-03-03 12:41:02 +00:00
}