This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Netrivialni dotazy | |
| ###########################x | |
| # 1) vypiste jmena odberatelu a pocet objednanych polozek (nerozlisujte zda jsou zaplaceny ci nikoliv) | |
| SELECT odberatel.jmeno, odberatel.prijmeni, COUNT( fakturapolozka.polozka_id ) AS pocet_polozek | |
| FROM odberatel | |
| LEFT JOIN faktura ON ( odberatel.odberatel_id = faktura.odberatel_id ) | |
| LEFT JOIN fakturapolozka ON ( faktura.cislo_faktury = fakturapolozka.cislo_faktury ) | |
| GROUP BY odberatel.odberatel_id | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | chrome.manifest = function() { | |
| var manifestObject = false; | |
| var request = new XMLHttpRequest(); | |
| request.onreadystatechange = function() { | |
| if (request.readyState == 4) { | |
| manifestObject = JSON.parse(request.responseText); | |
| } | |
| }; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // nejjednodusi zpusob | |
| function Thing(name) { | |
| this.name = name; | |
| } | |
| Thing.prototype.doSomething = function(callback) { | |
| // zavolani callbacku, this kuli kontextu | |
| callback.call(this); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // fce kterou volam | |
| function doSomething(callback) { | |
| // ... | |
| // volani callbacku | |
| callback('stuff', 'goes', 'here'); | |
| } | |
| // pripraveny callback | |
| function foo(a, b, c) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public function processEditForm(\Nette\Application\UI\Form $form) { | |
| $mealcat = new \MealCategory($form->getValues()); | |
| try { | |
| $this->facade->saveCategory($mealcat); | |
| } catch (\Exception $e) { | |
| $this->flashMessage($e->getMessage(), 'alert-error'); | |
| $this->flashMessage('Bohužel, kategorii se nepodařilo uložit', 'alert-error'); | |
| $this->redirect('Mealcategory:overview'); | |
| } | |
| $this->flashMessage('Kategorie uložena', 'alert-success'); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** | |
| * constructor | |
| * @param Nette\Database\Table\ActiveRow $row | |
| */ | |
| public function __construct(Nette\Database\Table\ActiveRow $row) { | |
| foreach ($row as $key => $value) { | |
| if (property_exists($this,$key)) | |
| $this->{$key} = $value; | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /** | |
| * Description of site | |
| * | |
| * @author Michal Haták [Twista] <me@twista.cz> | |
| * @package cms | |
| */ | |
| class Site extends Nette\Object { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              Show hidden characters
| { | |
| "cmd": ["phpunit", "-c","${project:${folder}}/phpunit.xml"], | |
| "encoding" : "utf-8", | |
| "selector" : "source.php", | |
| "shell" : true, | |
| "working_dir": "${project_path:${folder}}" | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| class PropertyAccess implements \ArrayAccess { | |
| public function offsetSet($offset, $value) { | |
| if(isset($this->offset)) | |
| $this->offset = $value; | |
| } | |
| public function offsetExists($offset) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class ExampleTest extends \PHPUnit_Framework_TestCase | |
| { | |
| public function setUp() | |
| { | |
| } | |
| public function testHelloWorld() | |
| { | |
| $this->assertEquals("hello", funkceCoVRACIHello()); // true |