Coder Social home page Coder Social logo

yii2-gii-plus's Introduction

Korben Dallas

Linkedin Mail

About me

I'm a senior software engineer. I like to work with Laravel, Vue and PHP. I love MacOs. I'm open-source development enthusiast.

I have experience in the development of payment gateways, integration with various payment systems, corporate accounting systems such as 1C, CRM, ERP, etc., Working with API Google, Yandex, various messengers, etc.

I love to move towards automating routine tasks, building the right architecture in development.

I have the strongest self-motivation. Resistant to stress.

Stack I work with

and others...

I can integrate with with

Interesting stats

Korben's stats

yii2-gii-plus's People

Contributors

dependabot[bot] avatar pvsaintpe avatar sereja3578 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sereja3578

yii2-gii-plus's Issues

Внедрить генерацию relation-методов в базовых моделях, старые пометить как @deprecated

Добавить генерацию новых методов, для получения relation-s (по внешним ключам - через связанные таблицы), следуя следующим правилам именования:

  1. Если в таблице есть прямой relation (FK), например: app_group_id, сгенерировать в базовом классе модели метод:
public function getAppGroup() {
  return $this->hasOne(...);
}
  1. Если в таблице есть FK, например playground_id (на таблицу playground, а в playground, есть FK: app_group_id на таблице app_group), сгенерировать следующий relation-метод:
public function getAppGroupViaPlayground() {
  return $this->hasOne(...);
}
  1. Проделать такое со связями глубиной не более чем в 2 таблицы, т.е. кол-во Via в имени метода не должно превышать 2.
  2. При отсутствии прямого relation в основной таблице на app_group_id, но имея relation на app_group через таблицу playground, сгенерировать два relation-метода, один:
  • getAppGroupViaPlayground()
  • а второй getAppGroup() - и в phpDoc пометить его как @deprecated, т.к. может уронить приложение и нужно время на его адаптацию под новые именования методов.
  1. Добавить все связи (прямые и через таблицы) в singularRelations, pluralRelations

Внедрить генерацию констант в таблицах справочниках

  1. Определение таблицы справочника:
  • PK (id, not Autoincrement, tinyInteger(4), unsigned)
  • наличие столбца code (string, unique)
  • наличие столбца name (string, unique) - priority unique 1
  1. К моделям, основанных на таблицах справочниках в базовых классах добавить:
  • use DictionaryTrait
  • implements DictionaryInterface
  • константы в формате с phpDoc:
/**
  * <name>
  * @message const
  */
 const <CODE_UPPER_CASE> = <id>;
  • добавить метод getContants() в формате:
/**
  * @return array
  */
public function getConstants()
{
    return [
        '<id>' => '<CODE_UPPER_CASE',
        ...
    ];
}
  1. Добавить компоненты в pvsaintpe\yii2-gii-plus:
  • DictionaryTrait
    • public getDocName(): string
    • public getMessage($code): string
    • public getMessages(): array
  • DictionaryInterface
    • public function getConstants()
    • public function getDocName()
  1. Обновить шаблоны генератора моделей (base_model)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.