This file contains 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 | |
$userService = new User\UserService($em, $cacheStorage); | |
$container->addService('userService', $userService); | |
$container->userService->getRepository()->findAllWithStar(); |
This file contains 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
/** | |
* @entity(serviceClass="EntityService") // tohle jsem chtěl zprovoznit, ale vyžadovalo by to úpravu Doctrine | |
* @service(class="EntityService") // takže jsem se spokojil s tímhle | |
*/ | |
class Entity | |
{ | |
} |
This file contains 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 | |
$entity = $repository->find($id); | |
$entity->getAssociation()->setProperty('new value'); | |
echo $entity->getAssocation()->getProperty(); // prints 'new value' | |
$em->persist($entity->getAssociation()); // pratically a useless row, the association entity should be already persisted | |
$em->flush(); | |
$em->refresh($entity->getAssociation()); | |
echo $entity->getAssocation()->getProperty(); // prints the old value |
This file contains 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 | |
/** | |
* This file is part of the Nette Framework (http://nette.org) | |
* | |
* Copyright (c) 2004, 2011 David Grudl (http://davidgrudl.com) | |
* | |
* For the full copyright and license information, please view | |
* the file license.txt that was distributed with this source code. | |
*/ |
This file contains 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
// Create a query | |
$ds = \dibi::dataSource('SELECT p.*, c.[name] as city FROM [people] p LEFT JOIN [cities] c ON p.[city_id] = c.[id]'); | |
// Create a data source | |
$dataSource = new \DataGrid\DataSources\Dibi\DataSource($ds); | |
// Configure data grid | |
$grid = new DataGrid; | |
$grid->setDataSource($dataSource); |
This file contains 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
// Create a query | |
$df = new \DibiFluent(\dibi::getConnection()); | |
$df->select('p.*') | |
->select('c.name')->as('city') | |
->from('%n', 'people', 'p') | |
->leftJoin('%n', 'cities', 'c') | |
->on('(p.[city_id] = c.[id])'); | |
// Configure data source | |
$dataSource = new \DataGrid\DataSources\Dibi\Fluent($df); |
This file contains 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 | |
namespace DataGrid\DataSources\Dibi; | |
use DataGrid\DataSources\IDataSource, | |
DataGrid\DataSources, | |
dibi, | |
DibiFluent; | |
/** | |
* Dibi fluent based data source |
This file contains 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 | |
namespace DataGrid\DataSources\Dibi; | |
use Nette, Doctrine, DataGrid, | |
DataGrid\DataSources\IDataSource, | |
DataGrid\DataSources, | |
dibi, DibiDataSource; | |
/** | |
* Dibi data source based data source |
NewerOlder