Files
kiri-core/Database/IOrm.php
T

51 lines
793 B
PHP
Raw Normal View History

2020-08-31 12:38:32 +08:00
<?php
/**
* Created by PhpStorm.
* User: whwyy
* Date: 2018/3/30 0030
* Time: 14:39
*/
2020-10-29 18:17:25 +08:00
declare(strict_types=1);
2020-08-31 12:38:32 +08:00
namespace Database;
/**
* Interface IOrm
* @package Database
*/
interface IOrm
{
/**
* @param $param
* @param null $db
* @return ActiveRecord
*/
2021-01-12 18:39:53 +08:00
public static function findOne($param, $db = NULL): mixed;
2020-08-31 12:38:32 +08:00
2020-11-12 00:07:46 +08:00
/**
* @return string
*/
2020-12-17 14:09:14 +08:00
public static function className(): string;
2020-11-12 00:07:46 +08:00
/**
* @return ActiveQuery
* return a sql queryBuilder
*/
2020-12-17 14:09:14 +08:00
public static function find(): ActiveQuery;
2020-11-12 00:07:46 +08:00
2020-08-31 12:38:32 +08:00
/**
* @param $dbName
* @return Connection
*/
2020-12-17 14:09:14 +08:00
public static function setDatabaseConnect($dbName): Connection;
2020-08-31 12:38:32 +08:00
// public static function deleteAll($condition, $attributes);
// public static function updateAll($condition, $attributes);
}