You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
payment/app/Model/Model.php

33 lines
617 B
PHP

<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\DbConnection\Model\Model as BaseModel;
abstract class Model extends BaseModel
{
public static function alias($alias = null)
{
$name = with(new static)->getTable();
if ($alias) {
$name .= ' as ' . $alias;
}
return $name;
}
public static function fromAlias($alias)
{
return static::from(static::alias($alias));
}
public function getRawAttribute($key)
{
if (! $key) {
return null;
}
return $this->attributes[$key] ?? null;
}
}