1. Go to this page and download the library: Download kappa/doctrine library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$crudManager = $this->crudManagerFactory->create(new User());
// or
$crudManager = $this->crudManagerFactory->create('Some\Entity\User');
$form = new Form();
$form->addSelect('parent', 'Parent item: ', $this->formItemsCreator->create('\UserEntity', new GetAll());
// or
$user = new User();
$form->addSelect('parent', 'Parent item: ', $this->formItemsCreator->create($user, new GetAll());
$this->formItemsCreator->create('\UserEntity', new GetAll());
$array = [
'1' => 'John'
];
$this->formItemsCreator->create('\UserEntity', new GetAll(), 'name', 'id');
class ExecutableQuery implements Executable
{
/**
* @param QueryBuilder $queryBuilder
* @return QueryBuilder
*/
public function build(QueryBuilder $queryBuilder)
{
$queryBuilder->update('KappaTests\Mocks\FormItemsEntity', 'r')
->set('r.title', $queryBuilder->expr()->literal('UPDATED'))
->where('r.id = ?0')
->setParameters(1);
return $queryBuilder;
}
}
// and
$this->queryExecutor->execute(new ExecutableQuery());
## RouteParamsResolver
You can use `Kappa\Doctrine\Routes\RouteParamsResolver` for easy works with `FILTER_IN/OUT` in your routes
**Example**
class Router
{
private $paramsResolver;
public function __construct(RouteParamsResolverFactory $factory)
{
$this->paramsResolver = $factory->create('App\Entities\Article');
}
/**
* @return \Nette\Application\IRouter
*/
public function createRouter()
{
$router = new RouteList();
$router[] = new Route('<presenter>/<action>[/<id>', [
'presenter' => 'Homepage',
'action' => 'default',
'id' => [
Route::FILTER_IN => [$this->paramsResolver, 'filterIn'],
Route::FILTER_IN => [$this->paramsResolver, 'filterOut']
]
]);
return $router;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.