2021-09-28 18:54:07 +08:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* Created by PhpStorm.
|
|
|
|
|
* User: whwyy
|
|
|
|
|
* Date: 2018/3/30 0030
|
|
|
|
|
* Time: 14:39
|
|
|
|
|
*/
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace Database;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Interface ModelInterface
|
|
|
|
|
* @package Database
|
|
|
|
|
*/
|
|
|
|
|
interface ModelInterface
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param $param
|
|
|
|
|
* @param null $db
|
|
|
|
|
* @return ModelInterface
|
|
|
|
|
*/
|
|
|
|
|
public static function findOne($param, $db = NULL): mixed;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string|int $param
|
|
|
|
|
* @return ModelInterface
|
|
|
|
|
*/
|
|
|
|
|
public static function find(string|int $param): mixed;
|
|
|
|
|
|
|
|
|
|
|
2021-11-11 03:11:41 +08:00
|
|
|
/**
|
|
|
|
|
* @param array $data
|
|
|
|
|
* @return static
|
|
|
|
|
*/
|
|
|
|
|
public static function populate(array $data): static;
|
2021-09-28 18:54:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return ActiveQuery
|
|
|
|
|
* return a sql queryBuilder
|
|
|
|
|
*/
|
|
|
|
|
public static function query(): ActiveQuery;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function getTable(): string;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return Connection
|
|
|
|
|
*/
|
|
|
|
|
public function getConnection(): Connection;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|