Ejemplo n.º 1
0
 public static function getFullDbObjectClass($dbObjectNameOrTableName)
 {
     /** @var CmfDbModel $calledClass */
     $calledClass = get_called_class();
     $modelClassName = call_user_func([$calledClass, 'getFullModelClassNameByName'], StringUtils::modelize($dbObjectNameOrTableName));
     return preg_replace('%' . $calledClass::$modelClassSuffix . '$%', '', $modelClassName);
 }
Ejemplo n.º 2
0
<?php

/**
 * @var array $columns
 * @var string $modelAlias
 * @var string $scaffoldConfigClassName
 * @var string $namespace
 * @var string $parentClass
 */
$fkColumns = [];
$contains = [];
foreach ($columns as $name => $column) {
    if (preg_match('%^(.+)_id$%', $name, $parts)) {
        $fkColumns[] = $name;
        $contains[] = "'" . \Swayok\Utils\StringUtils::modelize($parts[1]) . "'";
    }
}
$contains = implode(", ", $contains);
?>

<?php 
echo '<?php';
?>


namespace {{ $namespace }};

use {{ $scaffoldConfigParentClass }};
use PeskyCMF\Scaffold\DataGrid\DataGridFieldConfig;
use PeskyCMF\Scaffold\ItemDetails\ItemDetailsFieldConfig;