Skip to content

Commit

Permalink
update makeTableName
Browse files Browse the repository at this point in the history
  • Loading branch information
BMTmohammedtaha committed Nov 17, 2023
1 parent faccf31 commit 0315cbb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ private function getPrefixMethod(string $method): string
*/
private function makeTableName(): string
{
return strtolower((new NounConverter())->convertToPlural(Utils::camelToUnderscore(get_class($this))));
$name = (new \ReflectionClass($this))->getShortName();
return strtolower((new NounConverter())->convertToPlural(Utils::camelToUnderscore($name)));
}

/**
Expand Down Expand Up @@ -675,6 +676,7 @@ public static function create(array $data, $useTransaction = false)
throw new \InvalidArgumentException("Data array is empty.");
}


$success = true;
$v = (new DataValidator($data));

Expand Down Expand Up @@ -817,6 +819,7 @@ public function updateInTransaction()
*/
public static function get(array|string $columns = '*', ?callable $toQuery = null, ?DataRulesInterface $rules = null, ?self $model = null): ?DataCollectionInterface
{

$model = $model ?? static::newInstance();

$query = Query::select($model->getTable());
Expand Down

0 comments on commit 0315cbb

Please sign in to comment.