Micro-ORM/app/Model/JobModel.php

24 lines
582 B
PHP

<?php
namespace App\Model;
use App\Query\IJobQuery;
use App\Query\JobQuery;
use Fufle\ORM\Model as BaseModel;
class JobModel extends BaseModel {
//private string $table = 'jobs';
//protected static ?IJobQuery $query;
public int $id;
public float $budget;
public static function Initialize() {
echo "init ";
if (static::$query === null) {
echo "query ";
static::$query = new JobQuery(self::class);
}
}
public static function GetLast10() {
return self::QueryAll(self::$query->GetLast10());
}
}