eyjafjallajokull / symfony-rest-bundle Goto Github PK
View Code? Open in Web Editor NEWRESTful API autogenerated from Symfony+Doctrine entities
RESTful API autogenerated from Symfony+Doctrine entities
Have you thought about code refactoring to psr-x (1,2) following?
find way to validate entity before create or update
Methods create, update, getSingle should return response with Content-Location header pointing to uniq resource location.
Hi,
I'm stuck in create case. I've entity with relation. As I saw in example, I can create EntityA with existing EntityB as a relation, but I can't create cascade two entities.
For example POST with payload:
{
"title": "new",
"entity_b": {
"content": "test"
}
}
dosn't work
but
{
"title": "new",
"entity_b_id": 2
}
work
so I cant create comprehensive all entities.
Everything because few lines from RepositoryWrapper:
/**
* @param $entity
*
* @throws BadRequestException
*/
public function assignAssociatedEntities($entity) {
foreach ($this->metadata->getAssociationMappings() as $association) {
if (!empty($association['sourceToTargetKeyColumns'])) {
foreach ($association['sourceToTargetKeyColumns'] as $from => $to) {
$id = $idValue = $this->metadata->getFieldValue($entity, $from);
$associatedEntity = $this->manager->getRepository($association['targetEntity'])->find($id);
if ($associatedEntity === null) {
throw new BadRequestException('Related entity id not found', array($from => 'Id not found'));
}
$this->metadata->setFieldValue($entity, $association['fieldName'],
$this->manager->getReference($association['targetEntity'], $id));
}
}
}
}
so if related ID is null, RepositoryManager is throwing exception.
Any ideas : >?
Hello, I'm using your framework and it's fine.
But I want to give support to filter related entities by odata queries.
For example:
/Products?$filter=Categories/Name eq 'food'
Is this feature implemented?
Thx!
WBR
Generate documentation using doctrine, serializer and validator config files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.