- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1
Aktualizace #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aktualizace #10
Conversation
         janpecha
  
      
      
      commented
      
            janpecha
  
      
      
      commented
        Jan 4, 2017 
      
    
  
- zapnuto zvýrazňování syntaxe
- aktualizován changelog
- přidána stránka Mapper
- přidána stránka Ukázky použití a zajímavá řešení + CamelCase to under_score mapper (přesunuto z wiki https://github.com/Tharos/LeanMapper/wiki/camelcase-to-under-score-mapper)
- přidána stránka EntityFactory
- přidána stránka Integrace Lean Mapper do aplikace (přesunuto z wiki https://github.com/Tharos/LeanMapper/wiki/integrace-lean-mapperu-do-aplikace)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prosim o vyjadreni pripadne o upravy
| # registrace Lean Mapperu | ||
| - LeanMapper\Connection(%leanmapper%) | ||
| - LeanMapper\DefaultMapper | ||
| - LeanMapper\DefaultEntityFactory | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pokud si dobre vzpominam, tak tohle neni potreba definovat, existuje DI\Extension pro nette a dokonce regne i repozitare viz https://github.com/Tharos/LeanMapper/blob/develop/src/LeanMapper/Bridges/Nette/DI/LeanMapperExtension.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rozšíření pro Nette nepoužívám, ale ano, i to je jedna z cest. Ideální by asi bylo zmínit oboje - DI rozšíření jako doporučenou cestu a tohle nastavení jako alternativu pro ty, kteří nechtějí nemůžou DI rozšíření použít.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Přidal jsem část o použití DI rozšíření (snad je použito správně).
        
          
                cs/docs/integrace-do-aplikace.md
              
                Outdated
          
        
      |  | ||
| V rámci presenteru pak máme repositář přístupný přes `$this->bookRepository`. | ||
|  | ||
| **Tip:** pokud nechcete, nebo nemůžete použít anotaci `@inject`, lze pro předání repositáře použít constructor nebo [`inject*()` metodu](http://pla.nette.org/cs/inject-autowire). | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tohle bych napsal naopak. Konstruktor je jedine spravne reseni predani zavislosti. Injectovani, at uz pres anotace nebo pres metodu, je jen vseobecne pouzivana berlicka specialne pro presentery, aby se vyvojari vyhnuli problemu "contructor hell" pri velke dedicnosti, ktera je u presenteru bezna. V modelu aplikace (ve smyslu MVC) je nutne predat zavislosti vyhradne pres konstruktor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jasně, že ano. Psal jsem to hlavně s ohledem na začátečníky, kteří se snadno do contructor hellu v presenteru zapletou a jeho vyřešení je pro ně obtížné, pokročilejší uživatelé tohle nepotřebují, ti si to rovnou předají přes kontruktor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Přidal jsem předání přes konstruktor.
|  | ||
| Existuje mnoho důvodů proč v databázi pojmenovávat *sloupce/tabulky* pouze malými písmeny a jednotlivá slova oddělovat podtržítkem `_` *(tzv. under score konvence)*. Pokud bychom ale na straně PHP chtěli k těmto datům přistupovat pomocí *camel case konvence*, tedy vizuálně oddělovat velkým písmenem na začátku jednotlivých slov, **LeanMapper** k tomu nabízí všechny potřebné prostředky. | ||
|  | ||
| K zprovoznění této funkcionality postačí upravit [**mapper**](/cs/docs/mapper/), tedy třídu, která dědí po `LeanMapper\DefaultMapper` nebo jen implementuje rozhraní `LeanMapper\IMapper`. Nejprve si připravíme funkce, které nám budou převádět `fooBar` na `foo_bar` a obráceně. Můžeme je klidně implementovat jako statické veřejné metody vlastního mapperu. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Striktne vzato, metody pro prevod nazvu z jedne konvence do jine nepatri do Mapperu, ale jinam, kvuli pouzitelnosti mimo LeanMapper. Jejich implementace muze zustat staticka (stejne jako trida Strings z Nette) a v Mapperu to jen pouzit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Striktně vzato asi ano, ale pokud nikde jinde ty metody nepotřebujeme, nedává jejich vyčlenění do další třídy smysl. Navíc tohle je jen příklad, je asi zbytečné to komplikovat dalšími třídami.
| Jinak vyborna prace! ;-) | 
28e1638    to
    b78f27c      
    Compare
  
    |  | ||
| leanmapper: | ||
| db: | ||
| host: localhost | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
přidej sem ještě driver, ať je to stejné jako dole
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hotovo.
PS. přidal jsem ještě commit, který aktualizuje rok v patičce (z 2013-2016 na 2013-2017).
b78f27c    to
    67f20ac      
    Compare
  
    | great job ;) |