fsi / data-indexer
FSi DataIndexer Component - Component created to provide one simple object indexing strategy for FSi DataSource and DataGrid components.
Installs: 60 903
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 8
Forks: 3
Open Issues: 1
Requires
- php: ^7.1|^8.0
- doctrine/common: ^2.9|^3.0
- doctrine/orm: ^2.4
- doctrine/persistence: ^1.3|^2.0
- symfony/property-access: ^3.0|^4.0|^5.0
Requires (Dev)
- phpstan/phpstan: ^0.12.26
- phpstan/phpstan-phpunit: ^0.12.3
- phpunit/phpunit: ^7.5|^8.0
- squizlabs/php_codesniffer: ^3.4
README
This component is created to provide one simple object indexing strategy for FSi DataSource
and DataGrid
components.
Installation
Add fsi/data-indexer
to composer.json
{
...
"require": {
"fsi/data-indexer" : "^1.0@dev",
}
...
}
Usage
$dataIndexer = new DoctrineDataIndexer($this->getDoctrine(), "DemoBundle:News"); $news = News("this_is_id"); $index = $dataIndexer->getIndex($news); // value in $index "this_is_id" $entity = $dataIndexer->getData($index); // $entity value is a News object with id "this_is_id"
DoctrineDataIndexer handle single and composite keys