Comments (2)
https://github.com/josemsalves/testes
from doctrine-laminas-hydrator.
I had a short look in your sample code, but the code under https://github.com/josemsalves/testes has several other (non-related) issues - a simple docker compose up -d
doesn't get it running to repreduce the error you mentioned above. Please note that your application is outdated, as it is still using PHP 7.4. I recommend re-creating the project from the laminas-skeleton-application, to enable use of PHP 8.1.
Regarding your error message Call to a member function setValue() on null
, you should provide a traceback to show the relevant class/method where the error occurs. One think that I see as problematic in your code snippets above is that you are creating the fieldsets with new ClassName()
. Please take a look at the Laminas form documentation on how to use custom elements: https://docs.laminas.dev/laminas-form/v3/advanced/#creating-custom-elements. Elements should be created through the form factory, which initializes the elements correctly.
You should do something like this:
$this->add([
'type' => \Laminas\Form\Element\Collection::class,
'name' => 'mySubFieldsetElement',
'options' => [
'allow_add' => true,
'allow_remove' => true,
'target_element' => [
'type' => \Application\Form\MySubFieldset::class,
],
],
]);
Or, in case you need the target element object itself, try this:
$targetElement = $this->getFormFactory()->getFormElementManager()->get(\Application\Form\MySubFieldset::class);
$this->add([
'type' => \Laminas\Form\Element\Collection::class,
'name' => 'mySubFieldsetElement',
'options' => [
'allow_add' => true,
'allow_remove' => true,
'target_element' => $targetElement,
],
]);
from doctrine-laminas-hydrator.
Related Issues (17)
- Hydrating uploaded image array to entity HOT 2
- Deprecation notices from doctrine\common HOT 1
- DoctrineObject extractByReference on uninitialized variables (PHP 7.4) HOT 3
- README documentation links to zend framework HOT 1
- Issue with unassigned members / PHP 7.4 (Typed property must not be accessed before initialization) HOT 2
- Wrong case of decimal and bigint HOT 2
- Problem with file uploads HOT 10
- Proof-reading of documentation HOT 2
- Removal of identifier values in toMany() function HOT 9
- Backed Enum Hydration ends up in a type conversion HOT 6
- Documentation issues and hydration apparently not working for Embeddable HOT 5
- Add support for time_immutable and date_immutable
- Problem with the compare function of the AbstractCollectionStrategy HOT 6
- Association extraction HOT 1
- Hydrator is trying to update instead of replace collection entities - can this be prevented? HOT 1
- hydrate composite PK HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doctrine-laminas-hydrator.